课程: Mastering Web Developer Interview Code
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
What is a callback and how do you use it?
- [Instructor] A callback is a convention in JavaScript that is often used with asynchronous programming. So that's a common question that you'll get in an interview to explain and then maybe provide an example of how it works. So let's take a look. And as I mentioned, callbacks are used to do things asynchronously, or whenever you want to execute code not necessarily in order, but at a certain point in time or when an event takes place. Now, because of this, they're used often in events to take care of tasks, whenever the events are triggered. Callbacks often use the anonymous function, which means a functions with no names, because they're invoked immediately once the event takes place, so there's no need for a name. So let's take a look at an example of how it works, and what we're going to do, is do a slightly different version of what we did in the previous episode. Where we did some tips that would hover whenever you…
内容
-
-
-
How do you use the data- attribute in HTML?11 分钟 14 秒
-
(已锁定)
Are you comfortable using jQuery?11 分钟 32 秒
-
(已锁定)
Describe when you should use the bind() method5 分钟 21 秒
-
(已锁定)
Do you know how to use the conditional operator?3 分钟 43 秒
-
Have you used Ajax to load an external file?8 分钟 25 秒
-
(已锁定)
Have you used JavaScript templates?7 分钟 3 秒
-
(已锁定)
How do you manipulate the DOM?11 分钟 7 秒
-
(已锁定)
How do you search using functional programming?6 分钟 27 秒
-
How do you use a constructor to create instances?10 分钟 33 秒
-
(已锁定)
How do you use arrow functions in ES6?6 分钟 30 秒
-
(已锁定)
How do you use the Fetch API?7 分钟 22 秒
-
(已锁定)
How do you render JSON to a DOM element?9 分钟 36 秒
-
(已锁定)
How does an IIFE work?7 分钟 12 秒
-
(已锁定)
How does immutability work in JavaScript?4 分钟 12 秒
-
(已锁定)
How would you use JavaScript reduce()?3 分钟 54 秒
-
(已锁定)
Quick concepts: Do you have experience linting your code?2 分钟 31 秒
-
(已锁定)
What are event bubbling and propagation about?11 分钟 42 秒
-
(已锁定)
What does "use strict" do?3 分钟 28 秒
-
(已锁定)
What is a callback and how do you use it?8 分钟 51 秒
-
(已锁定)
What is the relationship between promises and callbacks?9 分钟 57 秒
-
(已锁定)
What is the virtual DOM?7 分钟 7 秒
-
(已锁定)
What is variable hoisting and how do you guard against it?8 分钟 43 秒
-
(已锁定)
What tooling options have you used in the past?7 分钟 11 秒
-
(已锁定)
When would you use recursion?6 分钟 25 秒
-
(已锁定)
Can you build a Sass mixin?7 分钟 57 秒
-
(已锁定)
Do you know how to use CSS variables?10 分钟 38 秒
-
(已锁定)
Animate an underline on hover in CSS9 分钟 48 秒
-
(已锁定)
Explain the difference between absolute and relative positioning7 分钟 55 秒
-
(已锁定)
How comfortable are you with Sass?12 分钟 10 秒
-
(已锁定)
How do you animate CSS?9 分钟 41 秒
-
(已锁定)
How do you debug CSS using your browser?10 分钟 47 秒
-
(已锁定)
How do you use calc() in CSS?9 分钟 56 秒
-
(已锁定)
How would you use flexbox to control horizontal alignment?7 分钟 21 秒
-
(已锁定)
In CSS, what's the difference between ems and rems?9 分钟 58 秒
-
(已锁定)
What's the difference between a pseudo-class and a pseudo-element?6 分钟 16 秒
-
(已锁定)
Do you know how to use npm?8 分钟 40 秒
-
(已锁定)
Do you have experience using version control?16 分钟 37 秒
-
(已锁定)
How does routing work in a modern web application?9 分钟 30 秒
-
-
-