how to access any argument in javascript
function test(a, b, c){
// console.log(arguments);
// console.log(JSON.stringify(arguments));
// console.log(typeof a);
// var sum = 0;
// for (var i = 0; i<arguments.length; i++){
// sum += arguments[i];
// }
// console.log(sum);
//for (var i = 0; i<arguments.length; i++){
// console.log(arguments[i]);
//}
console.log(arguments[0]);
}
test(10, 20, 30); function example() {
console.log(arguments);
console.log(arguments[0]);
} // Console outputs an array of each argument with its value
example('hi', 'hello');
// Outputs:
// ['hi', 'hello']
// 'hi'
Also in JavaScript:
- remove element json javascript
- remove attribute javascript
- node js http request get parameters
- how to check if a string has only alphabets in javascript
- ajax syntax in javascript
- use vue cdn with firestore
- how to update angular version
- website login and registartion source code jsp java
- js standard global
- responsive grid using antd
- smooth scrolll to id js
- log javascript
- react native loading
- classList has class
- cache buster in angular application
- js scroll to top
- styling element using jquery
- how to update node modules
- iterate object js
- node js code for saving first middle and last name
- react bootstrap make col disapear in small screens
- javascript Prevent Object MutationPassed
- javascript getmonth
- push a new route only triggers URL change but not location change