This file contains hidden or 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 saveScore(name, score) { | |
// Get the string data from localStorage | |
// Convert it to an array | |
const scoreStr = localStorage.getItem('score'); | |
let scoreArr; | |
const newScore = { name: name, score: score }; | |
// Add new score to the array | |
if (!scoreStr) { |
This file contains hidden or 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 findSmallest(array) { | |
var min = Infinity; // <== control variable used to check agains and store the value | |
for (var i = 0; i < array.length; i++) { | |
var currentNum = array[i]; | |
if (currentNum < min) { | |
min = currentNum; | |
} | |
} |
After this lesson you will be able to:
- Server side render HTML pages with Express.
- Understand what a
templating engine
, templates and server side rendering are and why we use them. - Understand and use
express-react-views
for creating dynamic templates. - Understand and use
JSX
syntax inexpress-react-views
.
📦02-express-server
┣ 📂node_modules
┣ 📂public
┃ ┃
┃ ┣ 📂css
┃ ┃ ┣ 📜about.css
┃ ┃ ┗ 📜main.css
┃ ┃
┃ ┣ 📂views