Leave comments formmated like so:
<details>
<summary>My Question Here</summary>
<hr>
And I will answer here
<hr>
<div id="contentAreaDiv"></app> |
<div id="app"></app> |
<div id="app"></app> |
Leave comments formmated like so:
<details>
<summary>My Question Here</summary>
<hr>
And I will answer here
<hr>
a |
Object Oriented Programming (OOP) refers to using self-contained pieces of code to develop applications. We call these self-contained pieces of code objects, better known as Classes in most OOP programming languages and Functions in JavaScript.
Objects can be thought of as the main actors in an application, or simply the main “things” or building blocks that do all the work. As you know by now, objects are everywhere in JavaScript since every component in JavaScript is an Object, including Functions, Strings, and Numbers.
function add(a, b) { | |
return a + b; | |
} | |
add(3, 4);//returns 7 | |
//This is a function that takes two arguments, a and b, and returns their sum. We will now curry this function: | |
function add(a) { | |
return function (b) { | |
return a + b; | |
} |
function iterativeFactorial(n) { | |
let product = 1; | |
for (let i = 1; i <= n; i++) { | |
product *= i; | |
} | |
return product; | |
} |
const vehicles = [ | |
{ make: ‘Honda’, model: ‘CR-V’, type: ‘suv’, price: 24045 }, | |
{ make: ‘Honda’, model: ‘Accord’, type: ‘sedan’, price: 22455 }, | |
{ make: ‘Mazda’, model: ‘Mazda 6’, type: ‘sedan’, price: 24195 }, | |
{ make: ‘Mazda’, model: ‘CX-9’, type: ‘suv’, price: 31520 }, | |
{ make: ‘Toyota’, model: ‘4Runner’, type: ‘suv’, price: 34210 }, | |
{ make: ‘Toyota’, model: ‘Sequoia’, type: ‘suv’, price: 45560 }, | |
{ make: ‘Toyota’, model: ‘Tacoma’, type: ‘truck’, price: 24320 }, | |
{ make: ‘Ford’, model: ‘F-150’, type: ‘truck’, price: 27110 }, |