@ -3679,7 +3676,7 @@ Let us find the first country in the array which has the letter 'o'
```js
```js
const countries = ['Finland', 'Estonia', 'Sweden', 'Norway', 'Iceland']
const countries = ['Finland', 'Estonia', 'Sweden', 'Norway', 'Iceland']
const index = countries.find((country) => country.includes('o'))
const index = countries.find((country) => country.includes('o'))
console.log(index // Estonia
console.log(index) // Estonia
```
```
#### 6. findIndex
#### 6. findIndex
@ -3718,7 +3715,7 @@ Let us find the index of the first country in the array which has exactly six ch
```js
```js
const countries = ['Finland', 'Estonia', 'Sweden', 'Norway', 'Iceland']
const countries = ['Finland', 'Estonia', 'Sweden', 'Norway', 'Iceland']
const index = countries.findIndex((country) => country.length === 6)
const index = countries.findIndex((country) => country.length === 6)
console.log(index //2
console.log(index) //2
```
```
Let us find the index of the first country in the array which has the letter 'o'.
Let us find the index of the first country in the array which has the letter 'o'.
@ -3726,7 +3723,7 @@ Let us find the index of the first country in the array which has the letter 'o'
```js
```js
const countries = ['Finland', 'Estonia', 'Sweden', 'Norway', 'Iceland']
const countries = ['Finland', 'Estonia', 'Sweden', 'Norway', 'Iceland']
const index = countries.findIndex((country) => country.includes('o'))
const index = countries.findIndex((country) => country.includes('o'))
console.log(index // 1
console.log(index) // 1
```
```
Let us move on to the next functional programming, some.
Let us move on to the next functional programming, some.
@ -3872,7 +3869,7 @@ Let use the class constructor to pass different properties for the class.
The constructor is a builtin function which allows as to create a blueprint for our object. The constructor function starts with a keyword constructor followed by a parenthesis. Inside the parenthesis we pass the properties of the object as parameter. We use the _this_ keyword to attach the constructor parameters with the class.
The constructor is a builtin function which allows as to create a blueprint for our object. The constructor function starts with a keyword constructor followed by a parenthesis. Inside the parenthesis we pass the properties of the object as parameter. We use the _this_ keyword to attach the constructor parameters with the class.
The following Person class constructor has firstName and lastName property. These properties are attached to the Person class using _this_ keyword. _This_ refers to the class itself.
The following Person class constructor has firstName and lastName property. These properties are attached to the Person class using _this_ keyword. _this_ refers to the class itself.