javascript - What is diference? -
this question has answer here:
i begginer in javascript, need theoretical explanation. what's mean ; behind } , why must put there? when work in php don't need put ; after function {} in case.
var orangecost = function(price) { var quantity = 5; console.log(quantity * price); }; orangecost(5);
i want know code or not because can't desired result in case:
var orangecost = function(price) { var quantity = 5; console.log(quantity * price); } orangecost(5);
when assign function variable, it's other assignment.
var amethod = function() { /*...*/ }; var anumber = 123;
in both cases, semicolons @ end optional. it's recommended add them avoid statements accidentally being combined if newline removed (say, during process of concatenating source code).
Comments
Post a Comment