Skip to content

Commit d748723

Browse files
committed
conversion changes
1 parent a74584f commit d748723

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

js_basics/conversionOperation.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
let score = 52;
2+
console.log(typeof(score)); // this gives u NUMBER as output
3+
4+
let scored = '85';
5+
console.log(typeof(scored)); // this gives u STRING as output
6+
7+
//string to number conversion
8+
console.log(typeof(Number(scored))); // in scored we store string but we convert here into numbr so output is number
9+
10+
11+
// "87" => 33
12+
// "jhf" => NAN
13+
//true = 1
14+
// false = 0

0 commit comments

Comments
 (0)