+ 1

How to use Function????

I am just now starting to use Java Script and all I know is how to use variables, and im not even done with that and i've not been able to learn anymore. Please someone tell me how. (For e.x., var = puppyPet how do i use function to make him move??)

27th Jan 2020, 7:12 PM
â„‚đ•™đ•Łđ•šđ•€đ•„đ•Ș
â„‚đ•™đ•Łđ•šđ•€đ•„đ•Ș - avatar
1 Answer
+ 3
function myFunctionName(n) { var x = 5; x += n; console.log(x); } myFunctionName(6); //Outputs 11 This is a really simple function; I suggest you look more into the JavaScript tutorial.
27th Jan 2020, 9:15 PM
Daniel C
Daniel C - avatar