How can I create a function that requires input in JavaScript?
Example:
var a = 0;
var b;
function A(int myInteger){ //should it be something like var myInteger?
// do something with myInteger
// print something or do a = myInteger;
}
function B(a){
// do something with recieved integer
}
Please help me.
There is no data types in JavaScript other than
vareverything is var in JS .So when passing variable need not be mention the var also .just pass your value .same on creating function also .just mention the variable name. That’s it .
so
//Cheers .
As all said ..welcome to JS and W3School too.