Wednesday November 4
Daily JS
JS Quiz
Instructions
Given the code below, write code to make the addNumbers
function work.
The below function does not work.
The variable twoPlusTwo gets set to undefined
.
Refactor the function to make it work.
Slack me a direct message of your attempt.
function addNumbers(numberA, numberB) {
console.log(numberA + numberB);
}
var twoPlusTwo = addNumbers(2, 2);
console.assert(twoPlusTwo === 4);
Topics
- document.querySelector
- Working with Elements
- innerHTML
- style
- Event Listeners
- Timing Things
- setTimeout
- setInterval
Code
https://github.com/TIY-LR-FEE-2015-Fall/lesson-03-03
Lab
Homework
https://github.com/TIY-LR-FEE-2015-Fall/assignments/tree/master/11-clock