Questions asked so far

Day 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

  • 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

  • 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

  • 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

  • what is a symbol?
  • what is undefined?
  • what is the difference between null and undefined?

Day 6

  • 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

  • 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

  • write me the code needed to call the bark() function if the dogIsHungry variable is true, and the sleep() 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

  • 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

  • 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 a parameter passed as object properties. Can you write a run() function that takes an object as parameter, with the distance and destination 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

  • 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

  • can you explain to me what hoisting is?
  • what is the difference between let/const and var declarations in regards to hoisting?

Day 13

  • what is a closure?

Day 14

  • what is the difference between call() and apply()
  • how can we achieve encapsulation in JavaScript?

Day 15

  • 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?

Day 16

  • describe in your own words what is the prototype of an object
  • do you find classes more intuitive to use?
  • what is the useful thing about getters and setters?

Day 17

  • what’s the main difference between Object.values() and Object.entries()?
  • describe what object destructuring means and what is the result of a destructuring operation
  • shallow cloning vs deep cloning: what’s the difference?

Day 18

  • how can we merge 2 objects?
  • what is the type of an array?
  • which are the various ways we can use to add an element to an array?

Day 19

  • explain me how to remove an item from an array
  • what is the best way to search the index of an element contained in the array?
  • illustrate the ways we can use to iterate an array

Day 20

  • imagine we have 2 arrays: [‘a’, ‘b’] and [‘c’, ’d’]. How can you join them and get an array with [‘a’, ‘b’, ‘c’, ’d’]?
  • use the sort() method of an array to sort [’d’, ‘b’, ‘a’, ‘c’] to sort by alphabetical order and get [‘a’, ‘b’, ‘c’, ’d’]

Day 21

  • create a bi-dimensional array or 3x3 cells, to generate a matrix with all the numbers from 1 to 9 (1-2-3, 4-5-6, 7-8-9)
  • how can we get the number of items contained in an array?
  • how can you change the value stored in a specific position of the array?

Day 22

  • write the code needed to create a shallow copy of a const car = { color: blue } object
  • write the code needed to compare two objects
  • take the car object above and write the code needed to make its color property read only, not editable

Day 23

  • Take the const car = { color: blue } object and transform it into a string in the JSON notation. Then parse it back again to an object.
  • Use the Intl functions to format the number 10 so it’s representing a $10 bill, and then format it to represent a 10€ bill
  • Take the string “JavaScript is amazing” and generate a new string with the text “JavaScript”, cutting the unneeded part

Day 24

  • Write 2 different ways to take the string “JavaScript is amazing” and generate a new string with the text “ama”, cutting the unneeded parts
  • Create a function that returns the maximum value between 4 multiplied 5 times and the square root of 130. All using the Math functions

Day 25

  • Create a regular expression that extracts a number from a string
  • Create a regular expression that checks if a string contains the word “dog”
  • Create a regular expression that counts the number of times the word “dog” appears

Day 26

  • write a function that accepts a string as input, checks if there is a number in the string, and extracts it as a number value
  • given the list of syntax errors, do you remember seeing some of them appear in your code? If not, which ones do you think you will encounter the most during your job?
  • what is Infinity in JavaScript?

Day 27

  • which devtools panel is going to be helpful to check the JavaScript files size?
  • which devtools panel is going to help debugging a script and figuring why a particular value has been assigned to a variable

Day 28

  • describe me what is a breakpoint and how is it useful when debugging
  • what is an exception? why would we want to throw an exception?

Day 29

  • write me a practical example of using setInterval(), and clearing the interval when something happens
  • do you think there is a problem in having too many callbacks nested one into another?
  • which are the 3 states of a promise?

Day 30

  • what does it mean that a promise has resolved?
  • how can we wait until multiple promises are resolved?
  • what is the purpose of the finally() method of a promise?

Day 31

  • what is the requirement we must have to use the await keyword in a function?
  • can you explain me how an async function call works?

Day 32

  • what is a higher order function?
  • what do we mean by declarative programming?
  • what are the benefits of immutability?

Day 33

  • what does it mean that functions in JavaScript are first class?
  • can you explain me the concept of composition?

Day 34

  • describe me what filter() is useful for
  • describe me what map() is useful for
  • describe me what reduce() is useful for

Day 35

  • write the code needed to run the run() function on an array of dogs names using map(). That function should print <dogname> is running! to the console
  • use reduce() to make a string with the names of the dogs contained in the array [‘togo’, ‘lessie’, ‘hachiko’, ‘balto’], separating with a comma until the last one is found. I want this string: “togo, lessie, hackiko, balto”.