Answers for "what is in javascript"

5

~~ in javascript

~~ used to convert some types to int (32 bit int)
Posted by: Guest on January-14-2020
7

what is ... in javascript

function sum(...numbers) {
	return numbers.reduce((accumulator, current) => {
		return accumulator += current;
	});
};
 
sum(1,2) // 3
sum(1,2,3,4,5) // 15
Posted by: Guest on January-14-2020
2

~~ in javascript

~~'-1' = -1
~~true = 1
~~false = 0
~~5.6 = 5
Posted by: Guest on January-14-2020
0

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
Posted by: Guest on February-18-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language