The year after year, I came to shenzhen to find work early, see some interesting (is he a wrong (° delta ° | | |)) of the interview questions!

Do a little sharing to remind the next person not to step on the pit

The first is the interview with YY. The company is located in Guangzhou, so I have a deep impression on some questions

The first question

x = 1 ; x.num = 1; str = 'a'; str.s = 'b';

console.log(x + x.num);

console.log(str + str.s);

What results will be printed, this is a more detailed problem, mainly examine

If you attempt to access attributes that have not been added successfully, you will get undefined. If you attempt to access attributes that have not been added successfully, you will get undefined

2. Add undefined to numbers and strings

This becomes 1 + undefined and ‘a’ + undefined get NaN and ‘aundefined’, respectively

The second question

This is a multiple choice question. Choose the correct statement

[‘1’, ‘2’, ‘3’]. Map (parseInt) returns [1,2,3]

JSON. Stringify (” ss “) will be an error

Number.MAX_VALUE == Number.MAX_VALUE + 1

“Bacabc “. Replace (‘b’, ‘b’) will get bacabc

D) I have to go to the hospital.

B will not be mentioned, but D will replace all B with re/B/I

As C did not study the MAX_VALUE of Number, it felt A little unreasonable and finally chose A

ParseInt (String, radix) has two arguments and the array map method passes each entry of the array and the index 0, 1, 2 so parseInt(String, radix) has two arguments. I’m going to go for C, and I’m going to put up an explanation of parseInt




To be continued…