javascript x number of parameters

function display_numbers(...numbers) {
	colors.forEach(function(x) {
  		console.log(x);
	});
}

// call it like:
display_numbers(1)
display_numbers(1, 2, 3, 4)
display_numbers(1, -1, 9, 0, 2)

4
10
Tuk 110 points

                                    var print_names = function(...names) {
    for (let i=0; i<names.length; i++) console.log(names[i]);
}

4 (10 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
js x amount of parameters javascript function unknown number of arguments javascript function takes in unknown number of arguments unknown number of arguments javascript js function with unknown number of arguments javascript function unknown number of parameters javascript function unknown number of argument best way to get unknown arguments in javascript javascript create function with unknown number of parameters javascript unknown number of parameters unknown number of parameters passing to function in javascript js unknown number of arguments unknown number of parameters javascript javascript number of arguments unknown amount of variables javascript unkown amount of variables javascript js function when don't know number of parameters how to make function with undefined amount of inputs react function unknown args how many class javascript accepts arguments how to take arguments with varying length in javascript check for amount of arguments js a function that takes the number as the argument and incriminates it by one in js js get unknown numbers of parameters js get unknown numbers of pa javascript function or parameters write a function that takes undefined number of arguments javascript arguments length mozilla javascript how to know the number of parameters in a function return the total number of parameters javascript how to check numbers of arguments in a method javasscript javascript arguments function that takes in one argument, an integer js js count parameters in a function javascript function that gets any number of arguments number of arguments in nodejs how to get unknown number of argumernt in js javascript undefined number of arguments creating function taking unknown number of arguments function that reads unknown arguments amount return last number of a argument javascript function with undifiend number of arguments Create a function that returns the number of arguments it was called with. pass n number of parameters in function javascript js three arguments number how to use an unknown amount of arguments in javascript javascript unknown parameters memorize js unknown args js create a function with unknown number of arguments using unknown amount of parameters in js javascript function parameters unknown number of integer arguments js method that takes in an unkown amount of string names how to make arguments quantity to be variable injs hwo to make function to take unjnown number of arguments in ES6 javascript returns the number of arguments passed to the function when called javascript accept an unknown number of params javascript many arguments in javascript javascript x number of parameters javascript unknown arguments how to pass n number of arguments in javascript javascript undefined amount of parameters js how to accept not known params python passing and using unknown number of arguments function with unknown number of arguments javascript javascript function with unknown number of parameters passing argument of unkown value into function javascript passing unknown argument in a function javascript Pass unknown number of arguments into javascript function what to do when you have unknown number of arguments
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source