Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript Implicit Conversion to Number

// numeric string used with - , / , * results number type

let result;

result = '4' - '2'; 
console.log(result); // 2

result = '4' - 2;
console.log(result); // 2

result = '4' * 2;
console.log(result); // 8

result = '4' / 2;
console.log(result); // 2
 
PREVIOUS NEXT
Tagged: #javascript #Implicit #Conversion #Number
ADD COMMENT
Topic
Name
7+1 =