Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

fuction with params code example

Example 1: javascript function variable arguments

function foo() {
  for (var i = 0; i < arguments.length; i++) {
    console.log(arguments[i]);
  }
}

foo(1,2,3);
//1
//2
//3

Example 2: parameters in javascript

function myFunction(x, y) {
  if (y === undefined) {
    y = 2;
  }
}

Tags:

Java Example

Related

login to postgres command prompt code example query information connected database flask sqlalchemy code example run a powershell command code example postgress dump code example how to compile and run java program from terminal code example sklearn pca all principal components code example how to get a parent of a gameobject in unity code example onclick of button navigate to another page react js code example v on click in a template vue code example elemnt not in array javascript code example c# console writeline the input that readline code example reverse characters in string python code example

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy