ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

JavaScript Interview Questions - Question 20

shorts

js

bindmethod

thiskeyword

coding

interview

questionsandanswers

javascriptinterviewquestions

Автор: ByteWarp Dev

Загружено: 2024-06-06

Просмотров: 35

Описание: ‪@ByteWarpDev‬ Presents
JavaScript Interview Questions

Question - 20:
Consider the following code:
const person = {
name: "John",
greet: function () {
console.log(this.name);
}
}

const greetFn = person.greet.bind({ name: "Jane" });

greetFn();

What will be the output of this code, and why?

Options:
a) "John"
b) "Jane"
c) undefined
d) ReferenceError

Answer:
b) "Jane"

Explanation:
In this code, we define an object "person" with a "name" property and a "greet" method. We then use the "bind" method to create a new function "greetFn" that binds its "this" context to "{ name: "Jane" }". When "greetFn" is invoked, it logs the "name" property of its bound "this" context, which is "Jane".

#bindmethod #thiskeyword #coding #interview #questionsandanswers #javascriptinterviewquestions

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
JavaScript Interview Questions - Question 20

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

JavaScript Interview Questions - Question 21 #debounce #functionthrottling #coding #interview #js

JavaScript Interview Questions - Question 21 #debounce #functionthrottling #coding #interview #js

JavaScript Interview Questions - Question 29 #objects #methods #thiskeyword #coding #interview #js

JavaScript Interview Questions - Question 29 #objects #methods #thiskeyword #coding #interview #js

JavaScript Interview Questions - Question 1

JavaScript Interview Questions - Question 1

JavaScript Interview Questions - Question 27 #variablehoisting #scope #functions #coding #interview

JavaScript Interview Questions - Question 27 #variablehoisting #scope #functions #coding #interview

JavaScript Interview Questions - Question 24 #prototypes #inheritance #oop #coding #interview #js

JavaScript Interview Questions - Question 24 #prototypes #inheritance #oop #coding #interview #js

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]