For this exercise you can use Repl.it or your code editor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Product(name, price) { | |
this.name = name; | |
this.price = price; | |
} | |
Product.prototype.nameAndPrice = function() { | |
console.log( | |
"The product's name is: " + this.name, | |
"and the product's price is: " + this.price, | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the DOM elements | |
const stopButton = document.querySelector("#stop-btn"); | |
const h1Tag = document.querySelector("h1"); | |
const second = 1000; | |
// Formats one digit number to a string with "0" | |
function concatZero (num){ // 1 22 | |
return ('0' + num ).slice(-2); // "01" "22" | |
} |