• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// @lib: es2015
2// @strict: true
3// @noImplicitAny: false
4// @allowJs: true
5// @checkJs: true
6// @noEmit: true
7
8// @fileName: jsdocArrayObjectPromiseImplicitAny.js
9/** @type {Array} */
10var anyArray = [5];
11
12/** @type {Array<number>} */
13var numberArray = [5];
14
15/**
16 * @param {Array} arr
17 * @return {Array}
18 */
19function returnAnyArray(arr) {
20  return arr;
21}
22
23/** @type {Promise} */
24var anyPromise = Promise.resolve(5);
25
26/** @type {Promise<number>} */
27var numberPromise = Promise.resolve(5);
28
29/**
30 * @param {Promise} pr
31 * @return {Promise}
32 */
33function returnAnyPromise(pr) {
34  return pr;
35}
36
37/** @type {Object} */
38var anyObject = {valueOf: 1}; // not an error since assigning to any.
39
40/** @type {Object<string, number>} */
41var paramedObject = {valueOf: 1};
42
43/**
44 * @param {Object} obj
45 * @return {Object}
46 */
47function returnAnyObject(obj) {
48  return obj;
49}
50