- JS Bin ➡️ https://jsbin.com/?js,console
- Chrome browser (Developer Tools -> console) ➡️ https://www.google.com/chrome/
- Sublime Text ➡️ https://www.sublimetext.com/
Use concatenation to join two strings together.
Use interpolation to embed JavaScript expressions inside a string (ES6).
HINT: Create a variable
and store a string
value inside it. Then embed this variable
inside a string using interpolation (template literals
syntax).
Use JS Bin ➡️ https://jsbin.com/?js,console. Write your code at the left, then press the run
button to see the result.
Define an Array
of names (strings
) and store it in a variable
.
Use one of the discussed loop
techniques to iterate
over the Array
and select names which starts with B.
Inside the loop, use an if
condition and compare the first character of each name with the letter B.
HINT: You may need to define second array to store the matching results. You can use console.log()
to see the what is stored inside your variables
.
Use JS Bin ➡️ https://jsbin.com/?js,console. Write your code at the left, then press the run
button to see the result.
Let's refactor the previous exercise and use a function
(use any type of function you'd like).
The function
takes two parameters
: one represents a list of names
and the other represents the first letter
to filter with.
Once you've created the function, call
it with two arguments
: a list of names (Array
) and a letter (String
).
HINT: Inside your function, don't forget to return
the result.
Use JS Bin ➡️ https://jsbin.com/?js,console. Write your code at the left, then press the run
button to see the result.
Write code in your browser (use Chrome Developer Tools console) that will mark all checkboxes as checked.
You can use this sample html page https://jsbin.com/yanekuciya/1/edit?html,js,output