Forwarded from FrontendQuiz - задачи с собеседований по фронтенду
Как будет отображаться следующий элемент?
Anonymous Quiz
15%
Поле ввода с текстом "Hello World"
9%
Пустое поле ввода
6%
Текст "Hello World"
55%
Ничего отображаться не будет
16%
Поле ввода со значением "********"
👍6
☝️Объяснение:
В JavaScript var создает переменную в контексте функции, а не контексте текущего scope. Это немного отличается от способа, который принят в типизированных языках, вроде Java или C++.
В JavaScript var создает переменную в контексте функции, а не контексте текущего scope. Это немного отличается от способа, который принят в типизированных языках, вроде Java или C++.
👍4
Как правильно, используя jQuery, изменить размер шрифта текста "Something"?
Вопрос: https://proghub.dev/q/d89329
Добавить свой вопрос
Вопрос: https://proghub.dev/q/d89329
Добавить свой вопрос
💩36👎1
Как правильно, используя jQuery, изменить размер шрифта текста "Something"?
Anonymous Quiz
19%
`$('a[href$=\\/]').find('span').css('fontSize','18px');`
12%
`$('a[href~=/]').find('span').css('fontSize','18px');`
19%
`$('a[href^=\\/]').find('span').css('fontSize','18px');`
23%
`$('a[href=/]').find('span').css('fontSize','18px');`
27%
`$('a[href*=\/]').find('span').css('fontSize','18px');`
💩61👍2🔥2👎1
Что выведет в консоль?
Anonymous Quiz
20%
"ninja" "pomidor" "site"
32%
undefined "pomidor" "site"
10%
"ninja" undefined undefined
13%
undefined undefined undefined
24%
ничего не выведет, возникнет ошибка
👍14
☝️Объяснение:
возникнет ошибка `error: Uncaught TypeError: Cannot read property 'name' of undefined`, документация по this + `use strict`: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strictmode#SecuringJavaScript
возникнет ошибка `error: Uncaught TypeError: Cannot read property 'name' of undefined`, документация по this + `use strict`: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strictmode#SecuringJavaScript
👍6
Выберите все примитивные типы данных
Anonymous Quiz
77%
string
5%
integer
5%
undefined
2%
float
6%
symbol
4%
object
💩74👍10👎4
Что выведет alert?
Anonymous Quiz
21%
object Window
44%
null
16%
undefined
15%
object Object
4%
this
👍10💩10👎1
☝️Объяснение:
ECMA-262, 3rd edition describes what should happen when null is passed in as the first argument to call():
If thisArg is null or undefined, the called function is passed the global object as the this value. Otherwise, the called function is passed ToObject(thisArg) as the this value.
ECMA-262, 3rd edition describes what should happen when null is passed in as the first argument to call():
If thisArg is null or undefined, the called function is passed the global object as the this value. Otherwise, the called function is passed ToObject(thisArg) as the this value.
👍17
Как правильно объявить цикл `for`?
Anonymous Quiz
2%
for (i <= 5; i++)
1%
for i = 1 to 5
2%
for (i = 0; i <= 5)
95%
for (i = 0; i <= 5; i++)
💩41👎2🔥2
👍1
☝️Объяснение:
$('#elem').is('visible'); - грамматически не верно,
$('#elem:hidden'); - просто выберет скрытые элементы,
$('#elem').attr('visible'); - не верный атрибут,
$('#elem').is(':hidden'); - верный селектор, согласно спецификации.
Вопрос: https://proghub.dev/q/5f2de7
🔥Добавить свой вопрос
$('#elem').is('visible'); - грамматически не верно,
$('#elem:hidden'); - просто выберет скрытые элементы,
$('#elem').attr('visible'); - не верный атрибут,
$('#elem').is(':hidden'); - верный селектор, согласно спецификации.
Вопрос: https://proghub.dev/q/5f2de7
🔥Добавить свой вопрос
💩7
Сколько элементов <span> будут отображаться после выполнения?
Тест: https://proghub.dev/t/jquery-basic
Добавить свой вопрос
Тест: https://proghub.dev/t/jquery-basic
Добавить свой вопрос
💩42👎3