- Fork this repo
- Clone your fork
- Fill in your answers by writing in the appropriate area, or placing an 'x' in the square brackets (for multiple-choice questions).
- Add/Commit/Push your changes to Github.
- Open a pull request.
What of the following are JavaScript Data Types?
Select all that apply:
[] String
[] Boolean
[] Undefined
[] NaN
[] Number
[] Array
[] Null
Explain what is a REPL, and why is it important for us as developers and help with debugging?
Given the Following Array
var foods = [ ["apple","banana","strawberry"], ["pizza","fries","hamburger"] ];
Create a For Loop that outputs the following string for each piece of fruit in the console. "I want to eat a [fruit]"
// write code here
Given the Following Array
var foods = [ ["apple","banana","strawberry"], ["pizza","fries","hamburger"] ];
How would I go about accessing the string "pizza" in the above array?
// write code here
Describe the rules of scope in JavaScript.
Your Answer:
Define an object and store it in a variable pizza
. The object should have 2
properties: a temperature (set to 70), and a method called bake
. When called,
this method should set the pizza's temperature to be 300. Note: you may not use
the variable pizza inside your method.
Your Answer:
// write code here
Using a 'for' loop, iterate over an array of numbers in JavaScript, printing each to the console.
Your Answer:
// write code here
Write the vanilla JS equivalent of the following jQuery code:
$("button").on("click", function(event){
$(event.target).css('color', 'red')
})
Your Answer:
// write code here
What are the differences between calling and referencing a function? Please provide examples of each.
Using the object literal notation, Define an object called student and give it the properties (your attributes) of name, age, and a method sayHello, that outputs "Hi, my name is [your_name]".
Your Answer:
// write code here
What is the difference between synchronous and asynchronous program execution?
Select all that apply:
[] Synchronous code runs at an even pace, asynchronous code runs with uneven pacing.
[] Synchronous code runs all at the same time, asynchronous code runs completely randomly
[] Synchronous code runs in order (as appears in the source), asynchronous code may run at a later time.