aquaopk.blogg.se

Quiz in javascript
Quiz in javascript












Whenever we declare a set a variable equal to an object, we're not actually giving that variable the value of that object.

quiz in javascript quiz in javascript

The bind method returns a copy of the bound function, meaning that we're simply logging a new, copied function 😃 The call method executes the (bound) function immediately, which results in Lydia is 21. call() executes the bound function immediatelyįirst, we log sayHi.call(person, 21).bind() only returns a copy of the bound function.In this example, we're saying that the this keyword within the sayHi function should refer to the person object by calling both bind and call on the sayHi function 🥳Īlthough the bind() and call() methods both allow us to specify which object the this keyword should refer to, there's a tiny difference: With the bind() and call() method, we can decide to which object the this keyword should refer. Sometimes I have to do things a certain way in order to be able to show certain behavior that may happen, and explain it that way 🙂 Of course, the examples are still minimal and don't show "the best/most performant way to do it". => Like, Subscribe, and share to Learn new every day.A long list of (advanced) JavaScript questions, and their explanations ✨ I will do my best to provide high-quality content for free on YouTube. >Support this video series by sharing it with your friends. We cover lots of cool stuff such as solutions to problems, concept explanations, and tricks to master in DSA. Tools used: - #Nodejs #Github #terminalCommands #postman #mongoDB > Overall my experience regarding this project was amazing !!














Quiz in javascript