$ javascript meaning code example
Example 1: what is javascript
JavaScript gives web pages interactive elements that engage a user.
Example 2: what does -= mean in JavaScript
/* JavaScript shorthand -=
-= is shorthand to subtract something from a
variable and store the result as that same variable.
*/
// The standard syntax:
var myVar = 5;
console.log(myVar) // 5
var myVar = myVar - 3;
console.log(myVar) // 2
// The shorthand:
var myVar = 5;
console.log(myVar) // 5
var myVar -= 3;
console.log(myVar) // 2
Example 3: what is javascript
javascript is a programming language by javascript you can make websites, apps etc..
Example 4: javascript % meaning
// % is the modulo operator
// It returns the rest of a division
// Example uses:
27 % 5
// returns 2, as 27/2 is 5 with rest 2.
99 % 13
// returns 8, as 99/13 is 7 with rest 8.
420 % 0
// returns NaN, as division by 0 is not calculatable.