Тест: Тест по основам N1
Список вопросов
1. Какой тип у {} |
|
1) array | |
2) null | |
3) funciton | |
4) object | |
2. Какой тип данных у null? |
|
1) array | |
2) undefined | |
3) object | |
4) syntax error | |
5) null | |
3. Какие имена из перечисленных допустимые для переменных? |
|
1) 1someVar, Var$ | |
2) my-var, my_var | |
3) _, $, myName | |
4) var, let, const | |
4. Что будет в консоли ? let user = {"name":"Smith", age: 30}; console.log(user['name'] == user.name); |
|
1) null | |
2) false | |
3) true | |
5. Что будет в консоли? console.log(+'-' + 2) |
|
1) 1 | |
2) -0 | |
3) NaN | |
6. Что будет в консоли? let str = '123'; let result = +str; console.log(typeof(result), result); |
|
1) string, 123 | |
2) number, '123' | |
3) string, '123' | |
4) number, 123 | |
7. Как узнать длину строки? |
|
1) string.getLength() | |
2) string.length | |
3) string.stringLength() | |
4) string.length() | |
8. Какое значение имеет объявленная переменная (например, var a;)? |
|
1) '' | |
2) null | |
3) undefined | |
9. Выберите корректное объявление переменной? |
|
1) let if | |
2) const __global | |
3) let var | |
4) var 21info | |
10. Что будет в консоли? let arr = [] arr[500] = 1 console.log(arr.length); |
|
1) 1 | |
2) Error | |
3) 501 | |
11. Как можно преобразовать строку в целое число? |
|
1) Integer.parse() | |
2) Number.convertTo() | |
3) parseInt() | |
4) Numberify() | |
12. Как полностью остановить работу цикла? |
|
1) pause | |
2) stop | |
3) break | |
4) continue | |
13. Какие есть циклы в JavaScript из перечисленных? |
|
1) while, for, do..while, for..of | |
2) while, for..of, loop | |
3) loop, for, while | |
4) circle, switch, forEach, while | |
14. Какой тип данных у NaN? |
|
1) number | |
2) NaN | |
3) null | |
4) object | |
15. Что будет в консоли? let y; if (y) { let y = 2; console.log(y); } else { let y = 10; console.log(y); } console.log(y); |
|
1) 10, undefined | |
2) 2, undefined | |
3) 2, 2 | |
4) 10, 10 | |
16. Что будет в консоли? const z = 1; z = 20; z++ console.log(z); |
|
1) 21 | |
2) 20 | |
3) NaN | |
4) Uncaught TypeError | |
17. Что будет в консоли? const obj = { brand: 'EasyCode' }; obj.country = 'Ukraine'; console.log(obj) |
|
1) null | |
2) { brand: 'EasyCode' } | |
3) {brand: |