Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

string format Javascript

const firstString = '2 + 2'; // Creates a string literal value
const secondString = new String('2 + 2'); // Creates a String object
eval(firstString); // Returns the number 4
eval(secondString); // Returns a String object containing "2 + 2"
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #string #format #Javascript
ADD COMMENT
Topic
Name
2+3 =