Outline
- JavaScript Fundamentals -- What is JavaScript?
- JavaScript Fundamentals -- Variables and Scope
- JavaScript Fundamentals -- Primitive Types
- JavaScript Fundamentals -- The this Keyword
-
JavaScript Fundamentals -- The JavaScript Console
- Introduction
- console.log + Exercise
- console.log Exercise Review
- console.info + Exercise
- console.info Exercise Review
- console.warn + Exercise
- console.warn Exercise Review
- console.error + Exercise
- console.error Exercise Review
- console.table + Exercise
- console.table Exercise Review
- console.assert + Exercise
- console.assert Exercise Review
- console.group + Exercise
- console.group Exercise Review
- Conclusion
-
JavaScript Fundamentals -- Logical and Comparison Operators
- Introduction to Logical and Comparison Operators
- Truthy and Falsy Values
- Comparison Operators -- Equality and Inequality
- Comparison Operators -- Equality and Inequality Exercise
- Comparison Operators -- Equality and Inequality Exercise Review
- Comparison Operators -- Relational
- Comparison Operators -- Relational Exercise
- Comparison Operators -- Relational Exercise Review
- Logical Operators -- Or
- Logical Operators -- Or Exercise
- Logical Operators -- Or Exercise Review
- Logical Operators -- And
- Logical Operators -- And Exercise
- Logical Operators -- And Exercise Review
- Logical Operators -- Not
- Logical Operators -- Not Exercise
- Logical Operators -- Not Exercise Review
- Logical Operators -- Nullish Coalescing
- Logical Operators -- Nullish Coalescing Exercise
- Logical Operators -- Nullish Coalescing Exercise Review
- Logical and Comparison Operators Conclusion
-
JavaScript Fundamentals -- Looping in JavaScript
- Introduction to Looping in JavaScript
- for Loops
- for Loops -- Why Use Them and Gotchas
- for ... of Loops
- Looping Exercise 1
- Looping Exercise 1 Review
- for ... in Loops
- Looping Exercise 2
- Looping Exercise 2 Review
- do while Loops
- Breaking out of Loops
- Skipping Passes Through Loops
- Looping Exercise 3
- Looping Exercise 3 Review
- Conclusion to Looping in JavaScript
-
JavaScript Fundamentals -- Functions in JavaScript
- Introduction to Functions in JavaScript
- Named Functions
- Anonymous Functions
- Arrow Functions
- Functions in JavaScript Exercise 1
- Functions in JavaScript Exercise 1 Review
- Default Parameters
- Named Parameters
- Rest Parameters
- Functions in JavaScript Exercise 2
- Functions in JavaScript Exercise 2 Review
- Functions in JavaScript Real Demo
- Conclusion to Functions in JavaScript
- JavaScript Fundamentals -- Strings, Numbers, & Dates
- JavaScript Fundamentals -- Objects in JavaScript
- JavaScript Fundamentals -- Arrays in JavaScript
- JavaScript Fundamentals -- Course Conclusion
Outline
- JavaScript Fundamentals -- What is JavaScript?
- JavaScript Fundamentals -- Variables and Scope
- JavaScript Fundamentals -- Primitive Types
- JavaScript Fundamentals -- The this Keyword
-
JavaScript Fundamentals -- The JavaScript Console
- Introduction
- console.log + Exercise
- console.log Exercise Review
- console.info + Exercise
- console.info Exercise Review
- console.warn + Exercise
- console.warn Exercise Review
- console.error + Exercise
- console.error Exercise Review
- console.table + Exercise
- console.table Exercise Review
- console.assert + Exercise
- console.assert Exercise Review
- console.group + Exercise
- console.group Exercise Review
- Conclusion
-
JavaScript Fundamentals -- Logical and Comparison Operators
- Introduction to Logical and Comparison Operators
- Truthy and Falsy Values
- Comparison Operators -- Equality and Inequality
- Comparison Operators -- Equality and Inequality Exercise
- Comparison Operators -- Equality and Inequality Exercise Review
- Comparison Operators -- Relational
- Comparison Operators -- Relational Exercise
- Comparison Operators -- Relational Exercise Review
- Logical Operators -- Or
- Logical Operators -- Or Exercise
- Logical Operators -- Or Exercise Review
- Logical Operators -- And
- Logical Operators -- And Exercise
- Logical Operators -- And Exercise Review
- Logical Operators -- Not
- Logical Operators -- Not Exercise
- Logical Operators -- Not Exercise Review
- Logical Operators -- Nullish Coalescing
- Logical Operators -- Nullish Coalescing Exercise
- Logical Operators -- Nullish Coalescing Exercise Review
- Logical and Comparison Operators Conclusion
-
JavaScript Fundamentals -- Looping in JavaScript
- Introduction to Looping in JavaScript
- for Loops
- for Loops -- Why Use Them and Gotchas
- for ... of Loops
- Looping Exercise 1
- Looping Exercise 1 Review
- for ... in Loops
- Looping Exercise 2
- Looping Exercise 2 Review
- do while Loops
- Breaking out of Loops
- Skipping Passes Through Loops
- Looping Exercise 3
- Looping Exercise 3 Review
- Conclusion to Looping in JavaScript
-
JavaScript Fundamentals -- Functions in JavaScript
- Introduction to Functions in JavaScript
- Named Functions
- Anonymous Functions
- Arrow Functions
- Functions in JavaScript Exercise 1
- Functions in JavaScript Exercise 1 Review
- Default Parameters
- Named Parameters
- Rest Parameters
- Functions in JavaScript Exercise 2
- Functions in JavaScript Exercise 2 Review
- Functions in JavaScript Real Demo
- Conclusion to Functions in JavaScript
- JavaScript Fundamentals -- Strings, Numbers, & Dates
- JavaScript Fundamentals -- Objects in JavaScript
- JavaScript Fundamentals -- Arrays in JavaScript
- JavaScript Fundamentals -- Course Conclusion
Here is a possible solution to this exercise:
// slice and splice
const pizzas = [
{ name: 'Pepperoni', price: 8 },
{ name: 'BBQ Chicken', price: 12 },
{ name: 'Hawaiian', price: 10 },
{ name: 'Meat Lovers', price: 12 },
];
// 1. Create a new array of pizzas from the first two pizzas in the array
const firstTwo = pizzas.slice(0, 2);
console.log(firstTwo);
// 2. Remove your least favorite pizza from the array
pizzas.splice(3, 1);
console.log(pizzas);
You can view this solution here on StackBlitz.