The JSDoc format describes the types of function arguments and return values. When calling the function, correct the types of arguments according to the types specified.
Why we want TypeScript?
Incorrect argument types
Report a typo
Write a program in JavaScript
//@ts-check
/**
* @param {string} arr1
* @param {boolean} arr2
* @param {number[]} arr3
* @returns {string}
*/
function clutter(arr1, arr2, arr3) {
let result = arr1 + arr2 + arr3[0]
return result
}
console.log(clutter(1, 1, ["9", -2]))
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.