javascript meaning code example
Example 1: ~~ in javascript
~~ used to convert some types to int (32 bit int)
Example 2: ... in javascript
function sum(x, y, z) {
return x + y + z;
}
const numbers = [1, 2, 3];
console.log(sum(...numbers));
console.log(sum.apply(null, numbers));
function sum(...numbers) {
let sum = 0;
for (const number of numbers)
sum += number;
return sum;
}
console.log(sum(1, 2, 3, 4, 5));
console.log(sum(4, 5, ...numbers));
Example 3: less than equal to in javascript
| <= | less than or equal to | x <= 8 | true |
Example 4: what is javascript
JavaScript gives web pages interactive elements that engage a user.
Example 5: what does -= mean in JavaScript
var myVar = 5;
console.log(myVar)
var myVar = myVar - 3;
console.log(myVar)
var myVar = 5;
console.log(myVar)
var myVar -= 3;
console.log(myVar)
Example 6: what is javascript
javascript is a programming language by javascript you can make websites, apps etc..