Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to return argument in javascript

function func1(a, b, c) {
  console.log(arguments[0]);
  // expected output: 1

  console.log(arguments[1]);
  // expected output: 2

  console.log(arguments[2]);
  // expected output: 3
}

func1(1, 2, 3);
> 1
> 2
> 3
Comment

how to return argument in javascript

function arrgu() {
  var sum = 0;
  for (var i in arguments) {
    sum = sum + arguments[i];
  }
  document.write(sum);
}
arrgu(10, 20, 30, 40);
arrgu(20, 40, 60); 
>100
>120
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript date validation less than today 
Javascript :: convert data image url into an image file 
Javascript :: vue router url string 
Javascript :: js change classlist 
Javascript :: update in mongoose node js 
Javascript :: javascript open window 
Javascript :: knex.js migration create 
Javascript :: javascript append list 
Javascript :: parsley validation error placement 
Javascript :: js origin without port 
Javascript :: overflowx javascript 
Javascript :: d3 paning 
Javascript :: manage nodejs versions on windows 
Javascript :: how to convert decimal to roman in javascript 
Javascript :: nullish coalescing operator 
Javascript :: form validation for email in js 
Javascript :: javascript add to home screen button 
Javascript :: js array remove undefined values 
Javascript :: javascript read word document 
Javascript :: react emoji picker 
Javascript :: js round 2 decimals 
Javascript :: loop through async javascript -4 
Javascript :: selected dropdown value 
Javascript :: target child event 
Javascript :: how to get value inside span using javascript 
Javascript :: regex js 
Javascript :: how to add footer in every page jspdf 
Javascript :: big o notation javascript 
Javascript :: Country API JavaScript Code 
Javascript :: iteratea on values map js 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =