JavaScript Doubts

Post your JavaScript related doubts/conversations here! Topics will be visible to your Teaching Assistants and Peers. Your doubts will be cleared within 24 hours! :grinning:

2 Likes

var k = β€œ20”;
var ans1 = number(k);
console.log(ans1,typeof(ans1));

var k = number(null);
console.log(k,typeof(k));

var k = number(true);
console.log(k,typeof(k))
mam why i can’t get output … .explicit conversion

3 Likes

Hi laxmikumarbilla68732,

For this one you should use var ans1=Number(K), instead of number(k).

var k = β€œ20”;
var ans1 = Number(k);
console.log(ans1,typeof(ans1));

var k = Number(null);
console.log(k,typeof(k));

var k = Number(true);
console.log(k,typeof(k))

It will work.

2 Likes

console.log(β€œfoo” + + β€œbar”)
result = fooNaN

Please explain the result

Not number using Number

Result as number is undefined.

javascript assignment should submit by google drive or codepen??

Hi @shivtech1906 , can you please clarify this query.

as you wish preferred codepen.

1 Like