Questions
Day 1 – Module 1
- tell me what is a value, a type and a variable. And the differences between those 3 concepts
- what does it mean that JavaScript is loosely typed?
- what is the difference between let, const and var variable declarations?
Day 2 – Module 1
- explain me the concept of this in JS
- describe me in your words what is scope
- do you think enabling strict mode is important? Why?
Day 3 – Module 1 & 2
- why do we need to stop the propagation of events?
- what is the main difference between primitive types and objects?
- how can we join two or more strings? provide me a code sample.
Day 4 – Module 2
- can we change the value of a string?
- can you explain why we can’t precisely make a simple operation like adding 0.1 and 0.2? Can you make a small, working example of how would you retrieve 0.3 by adding 0.1 and 0.2?
- what is a key feature of template literals that makes us prefer them over quotes when we define a string?
Day 5 – Module 2
- what is a symbol?
- what is undefined?
- what is the difference between null and undefined?
Day 6 – Module 2
- is there any difference between an object defined using the object literal syntax, and one created using the Object() constructor?
- in which different ways can we access the value of a property of an object?
- how is a method different than a function? Send me a sample method, and a sample function.
Day 7 – Module 2
- how can you convert the number 2 to a string? Show me a code sample.
- how can you convert the string ‘2’ to a number? Show me a code sample.
- how can you tell what type a value is?
Day 8 – Module 3
- write me the code needed to call the
bark()
function if thedogIsHungry
variable is true, and thesleep()
function if it’s false - in a switch statement, why do we need to add a break or a return at the end of each switch case?
- what are the ways we can break out of a
for
loop?
Day 9 – Module 3
- tell me all the different ways to create a loop in JavaScript. Send me some sample loops examples.
- explain in your own words how can “immediately invoked function expressions” help when it comes to using the loop index inside a function, inside the loop. Why do we have to wrap them in an additional function?
Day 10 – Module 4
- why do we have multiple ways to define functions?
- how are arrow functions different than regular functions?
- object destructuring allows to have a nice way to extract prarameter passed as object properties. Can you write a
run()
function that takes an object as parameter, with thedistance
anddestination
properties, and print them in a console.log()? When I call run() I want you to print the string “I ran for until I got to “.
Day 11 – Module 4
- Functions return only one value. Which ways do we have to simulate retruning multiple values from a function?
- The event loop is crucial to understanding how JavaScript works. Read the lesson on the event loop and then try to explain to me how it works
- What would happen if we don’t return anything from a recursive function? Can we even have a recursive function if we don’t return a value?
Day 12 – Module 4
- can you explain to me what hoisting is?
- what is the difference between let/const and var declarations in regards to hoisting?
Day 13 – Module 4
- what is a closure?
Day 14 – Module 4
- what is the difference between call() and apply()
- how can we achieve encapsulation in JavaScript?
Day 15 – Modules 5 & 6
- tell me the various ways you can use to initialize an object
- how can you set a property of an object? And how can you get its value?
- what is a method? What’s the difference between a method and a function?