Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript Convert to Number Explicitly 
Javascript :: javascript continue with Nested Loop 
Javascript :: merge sort 
Javascript :: javascript function expressions 
Javascript :: javascript Adding Element to the Outer Array 
Javascript :: javascript Symbols are not included in for...in Loop 
Javascript :: javascript Passing Parameter as Default Values 
Javascript :: JavaScript Destructuring - Before ES6 
Javascript :: JavaScript pauses the async function until the promise 
Javascript :: JavaScript Generator Throw Method 
Javascript :: JavaScript HTML DOM Collections 
Javascript :: ejs split string 
Javascript :: what does this operation tell if(!arr.some(isNaN)) JavaScript 
Javascript :: vite config js load env 
Javascript :: Create & Download PDF from Byte[] Array using jQuery AJAX 
Javascript :: set display size phaser 
Javascript :: phaser place on circles 
Javascript :: phaser animation from json 
Javascript :: closre in js 
Javascript :: axios imgbb 
Javascript :: string variable 
Javascript :: nestjs TS2339 
Javascript :: Assigning All NodeLists A New Function 
Javascript :: javascript static methods 
Javascript :: loop on each character js 
Javascript :: input variable in string javascript 
Javascript :: javascript load content from file 
Javascript :: rest parameters javascript 
Javascript :: history of react js 
Javascript :: how to unfreeze object in javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =