Answers for "what is the % in javascript"

1

What is $ in javascript

//----------------------------------------
//Question:What is ${variable_name} in javascript?
//----------------------------------------
//You can insert variables in a string (If you write string in backtick)
//Example
const username = "Omar";
//This will Work!
console.log(`The username is ${username}`)//The username is Omar
//These wont Work!
console.log("The username is ${username}")//The username is ${username}
console.log('The username is ${username}')//The username is ${username}
Posted by: Guest on December-30-2021
8

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

Code answers related to "what is the % in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language