@@ -78,7 +78,7 @@ new Book("The Martian", "Andy Weir");
/**
* Represents a book.
*/
Book=(title,author)=>{
functionBook(title,author){
this.title=title;
this.author=author;
}
...
...
@@ -91,10 +91,10 @@ Book = (title, author) => {
Sometimes you want to refactor already written code into a separate function or constant to reuse it later. Select the lines you want to refactor out and press kb(editor.action.quickFix) or click the little light bulb and choose one of the respective `Extract to...` options. Try it by selecting the code inside the `if`-clause on line 3 or any other common code you want to refactor out.
```js
findFirstEvenNumber=(arr)=>{
for(constiinarr){
if(typeofarr[i]==='number'&&arr[i]%2===0){
returnarr[i];
functionfindFirstEvenNumber(arr){
for(constelofarr){
if(typeofel==='number'&&el%2===0){
returnel;
}
}
returnnull;
...
...
@@ -108,9 +108,9 @@ Keeping your code looking great is hard without a good formatter. Luckily it's
```js
constcars=["🚗","🚙","🚕"];
for(constiincars){
// Drive the car
console.log(`This is the car ${cars[i]}`);
for(constcarofcars){
// Drive the car
console.log(`This is the car ${car}`);
}
```
...
...
@@ -144,7 +144,7 @@ Errors and warnings are highlighted as you edit your code with squiggles. In th