- create "firstName" and "last_name" variables
- assign your values
- create "address" variable and assign "main street" value to it
- re-assign address to "first street" later
- log all values in the console
- create "street" and "country" variables
- assign your values
- create "fullMailingAddress" variable and assign the result of "street + country"
- remember about the space
- log "fullMailingAddress" in the console
- create "score1", "score2", "score3" variables and assign values (0-100)
- calculate total score and average score, and assign them to the variables.
- log total score and average score
- create "plates" variable and assign 20
- create "people" variable and assign 7
- calculate remaining plates and assign to the variable
- add one to remaining plates
- create message variable and display 'There are (your value goes here) plates available' - string concatenation
- log message
- create "fruits" array and store some fruit values
- setup the last item as number (random)
- assign first fruit to the variable
- re-assign last array item to the actual fruit
- log both first fruit variable and entire fruits array
- create "calculateTotal" function
- add two parameters subTotal, tax
- return sum of parameters
- create 3 vars "order1","order2","order3"
- call calculateResult, pass in some values and assign result to each order
- log all three orders
- refactor "calculateTotal" to function expression
- create car object
- add make, model, year, colors (array), hybrid (boolean) keys
- add two methods (drive and stop)
- in the function body setup log with random text
- log make
- log first color
- invoke both methods
-
create two objects "person1", "person2"
-
setup name,age (15-25), status ('resident', 'tourist') keys
-
setup if else, condition where age must be bigger than 18 and status must be equal to 'resident'
-
test with both objects
- create function fullName
- accept two parameters "firstName", "lastName"
- add them together (concat) and return result in uppercase
- invoke fullName and pass some values
- log result
- change the order of arguments
- refactor to object parameter
Multiple Videos
- setup students array with 5 students { id: 1, name: 'peter', score: 80, favoriteSubject: 'math', },
- easer to manage code base (file, project)
- order matters
- other ways to achieve the same result (ES6 modules, fetch DB )
- not limited to just static data
- add role:'student' property to each object using MAP method
- assign to 'updatedStudents' variable and log
- filter array and return only scores >= 80
- assign to 'highScores' variable and log
- find specific id in array
- assign to 'specificId' variable and log
- sum up all student.score values with reduce
- divide by the length of the students array
- assign to 'averageScore' and log
- list favorite subjects with reduce { english: 1 history: 1 math: 3 }
- assign to survey and log