Back on the Arrays today - refreshed a few bits of knowledge with the Lunch Picker program in returning a random item from the array using the Math.random function.
let i = Math.floor(Math.random() * a.length);
Also something so simple like returning an array but wanting to separate the array items using a comma and a space caught me out so had to remember to join the array by putting the comma and space in there.
Remember when using the split, reverse & join that you do not need the str in front of it. It can be all done in one:
const newStr = str.split("").reverse().join("");
Its been quite interesting working through the objects section also as there were a few that I had done previously so had seen the changes that were made and still some bits I got stuck on again.
- HTML - 214 out of 214 Steps Completed
- CSS - 1156 out of 1156 Steps Completed
- JavaScript - 209 out of 918 Steps Completed
- 6 Challenges Completed
What have I completed today
-
Arrays
- Lab: Build a Lunch Picker Program
- Lab: Build a Golf Score Translator
- Lab: Build a String Inverter
- Lecture: Working with Common Array Methods
- Review: JavaScript Arrays Review
- Quiz: JavaScript Arrays Quiz
-
Objects
- Lecture: Working with Objects
- Workshop: Build a Recipe Tracker
- Lab: Build a Quiz Game
- Lab: Build a Record Collection
- Review: Javascript Objects Review
- Quiz: Javascript Objects Quiz
What is next on the list
- Loops
- Lecture: Working with Loops
- Workshop: Build a Sentence Analyzer
- Lab: Build a Longest Word Finder App
- Lab: Build a Factorial Calendar
- Lab: Implement the Mutations Algorithm
- Lab: Implement the Chunky Monkey Algorithm
- Lab: Build a String Repeating Function
- Lab: Build a Profile Lookup
- Review: Javascript Loops Review
- Quiz: Javascript Loops Quiz
What have I been reading?
-