JawaScript Practice Questions
Ye Questions JavaScript ke interview me Puchhe ja chuke hai.
Q1 - console.log('A' + 3); What is output. Ans is - A3
Esme Error nhi aayga dono concat ho jayga
Q2 - console.log('Name' + '100'); What is output. Ans is - Name 100
Ye dono to str hi hai to ye bhi contact ho jayga.
Q3 - console.log('2' +2+ '2'); What is output. Ans is - 222
Esame pahala 2 str hai or 2sara 2 int hai to ye dono concat ho jaynge or 22 ho jaynge fir 3sara 2 str hai to ye un dono 2 me contact ho jayga.
Q4 - console.log('2' +2- '2'); What is output. Ans is - 20
1st 2 or 2nd 2 contact hokar 22 ho jaynge fir last 2 - ho jayga 22 me se = 22 -2 = 20
Q5 - Print NaN in to methods.
1. console.log('Name' - 3); Ans is NaN
2. console.log(true * 'abc');Ans is NaN
1. Str me se ham number - nhi kar sakte hai. Esliy result is Not a number aayga.
2. True ka matlab hai 1 to ye ak number ho gya or number se str me ham koe bhi calculation nhi kar sakte hai.
टिप्पणियाँ
एक टिप्पणी भेजें