Answers for "js use param object or multiple"

1

parameters types in javascript

/**
 * My function description
 * @param {String} a
 * @param {String} b
 * @param {Number} amount
 * @example
 * // returns "fooBar fooBar"
 * myFunction('foo', 'Bar', 2)
 * @returns {String}
 */
function myFunction(a, b, amount){
  //do stuff
}
//Note that javascript is not a statically typed language and therefore you
//will not recieve any syntax errors for passing in the wrong types.
//The above code works in Visual Studio Code and intellisense.
Posted by: Guest on June-23-2020
0

js use param object or multiple

Like many of the others, I often prefer passing an options object to
a function instead of passing a long list of parameters, but it
really depends on the exact context.

I use code readability as the litmus test.
Posted by: Guest on October-13-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language