{"id":20573149,"url":"https://github.com/coderdost/javascript-course-2023","last_synced_at":"2025-04-09T18:19:56.126Z","repository":{"id":152566109,"uuid":"616172636","full_name":"coderdost/JavaScript-Course-2023","owner":"coderdost","description":"JavaScript course for beginners  on CoderDost Youtube Channel","archived":false,"fork":false,"pushed_at":"2023-09-21T21:09:00.000Z","size":896,"stargazers_count":171,"open_issues_count":4,"forks_count":107,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-09T18:19:48.370Z","etag":null,"topics":["ecmascript6","javascript","tutorials"],"latest_commit_sha":null,"homepage":"https://www.youtube.com/coderdost","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderdost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-19T20:12:29.000Z","updated_at":"2025-03-17T10:21:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"98aaafc4-323d-4afa-8c3a-7b9fb83bcfe0","html_url":"https://github.com/coderdost/JavaScript-Course-2023","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderdost%2FJavaScript-Course-2023","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderdost%2FJavaScript-Course-2023/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderdost%2FJavaScript-Course-2023/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderdost%2FJavaScript-Course-2023/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderdost","download_url":"https://codeload.github.com/coderdost/JavaScript-Course-2023/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085324,"owners_count":21045139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecmascript6","javascript","tutorials"],"created_at":"2024-11-16T05:25:50.883Z","updated_at":"2025-04-09T18:19:56.106Z","avatar_url":"https://github.com/coderdost.png","language":null,"readme":"# JavaScript Full Course 2023\n\n- [JavaScript Video](https://youtu.be/lGmRnu--iU8)\n\n- [Course Notes Slide PDF](slides.pdf)\n\n- [Advanced JavaScript Video](https://www.youtube.com/watch?v=gUUCmRJjVvo)\n- [Advanced JavaScript Notes](https://coderdost.github.io/)\n\n### Note: More questions to be updated in 24 Hours.\n\n## Chapter 1 (Data Types)\n\n### Assignments\n\n**1.1:** Create a code to check difference between `null` and `undefined` data type. Also check their type using `typeof`.\n\n**1.2:** Which type of variables (var, let or const) must be **initialized** at the time of declaration?\n\n**1.3:** Guess the **Output** and Explain Why?\n\n_[From video lecture 1.5]_\n\n```js\nlet languages = 'java javaScript python cSharp';\n\nlet result = languages.lastIndexOf('S');\n\nconsole.log(result);\n```\n\n**1.4:** Guess the **Output** and Explain Why?\n\n_[From video lecture 1.8]_\n\n```js\nlet variable = 'hello programmers';\n\nlet result = Number(variable);\n\nconsole.log(result);\n```\n\n**1.5:** Guess the **Output** and Explain Why?\n\n```js\nlet num1 = 32;\n\nlet num2 = '32';\n\nlet result1 = num1 !== num2;\n\nlet result2 = num1 != num2;\n\nconsole.log(result1, result2);\n```\n\n**1.6:** Guess the **Output** and explain Why?\n\n```js\nlet str = 'Hello Programmers';\n\nlet result = str.includes('r');\n\nconsole.log(result);\n```\n\n**1.7:** Guess the **Output** and Explain Why?\n\n_[From video lecture 1.6]_\n\n```js\nlet num1 = 2;\n\nlet num2 = 5;\n\nlet result = num1 ** num2 * 2;\n\nconsole.log(result);\n```\n\n**1.8:** Guess the **Output** and Explain Why?\n\n```js\nlet num1 = [1, 2, 4, 5];\n\nlet num2 = [6, 5, 8, 0];\n\nlet result = num1.concat(num2);\n\nconsole.log(result);\n```\n\n**1.9:** Guess the **Output** and Explain Why?\n\n```js\nlet a = 5;\n\nlet b = 7;\n\nlet c = 8;\n\nlet result = a \u003c b \u003e c;\n\nconsole.log(result);\n```\n\n**1.10:** If your State is split into **four** equal parts such that in each part there are **1/4** number of people live. You have to find how many people would live in each part? which operators will you use ?\n\n_[From video lecture 1.6]_\n\n## Chapter 2 (Control Flow / Conditional)\n\n### Assignments:\n\n**2.1:** Guess the **Output** And Explain Why?\n\n```js\nlet i = 4;\n\nfor (let j = 0; i \u003c 10; i++) {\n  if (j === 1 || i === 6) {\n    continue;\n  } else {\n    console.log(i, j);\n\n    if (i === 7) {\n      break;\n    }\n  }\n}\n```\n\n**2.2:** Guess the **Output** and Explain Why?\n\n```js\nlet i = 0;\n\nfor (i; i \u003c 5; i++) {\n  console.log(i);\n}\n```\n\n**2.3:** Write a simple **Program** in which You have to print first **10** numbers in **descending** order (10...1)?\n\n**2.4:** Lets say `John` is looking a new `country` to live in. He want to live in a country that speaks `English`, has less than 10 million people. One of the `food` option between these two must present `Spanish food` OR `English food`.\n\n**Write** an if/else if statement to help john figure out Your country is right for him?\n\n_[From video lecture 2.4]_\n\n**2.5:** Guess the **Output** And Explain Why?\n\n```js\nfor (let i = 0; i \u003c 10; i++) {\n  console.log(i);\n}\n\nconsole.log(i);\n```\n\n**2.6:** use **nested-if** statement to check your `age\u003e18`\n\nthan check your height `height \u003e 5.10`.\n\nIf **both** true show any message(**I can sit in exam**) in the console?\n\n**2.7:** Create two variables `grade` and `passingYear`.Check if your `grade == \"A\"` and `passingYear \u003c 2020` with the help of **ternary** operator(Not allowed to use any logical operator).If both condition `true` print on console **Qualify**. Otherwise **Fail**\n\n_[From video lecture 2.9]_\n\n## Chapter 3 (Functions)\n\n### Assignments\n\n**3.1:** Create a **function Declaration** called `describeYourState` Which take three parameters `Population`, `traditional food` and `historical place`. Based on this input function should return a `String` with this format.\n\n**My state population is ** Its traditional food is ** and historical place name is \\_\\_\\_**\n\n**3.2:** Create a **function expression** which does the exact same thing as defined in **Question 1**\n\n**3.3:** Create function **addition** which takes two numbers as an argument And return the result of **sum of two numbers**\n\n**Important Note**: In the function call you are **not** passing any **parameter**. You can modify function to achieve this.\n\n_[From video lecture 3.2]_\n\n```js\nExample;\n\nfunction addition(num1, num2) {\n  return num1 + num2;\n}\n\nconsole.log(addition()); //You are not allowed to modify this line any more\n```\n\n**3.4:** Identify which **type** of value passed below into the function **greet()**. What will be the return value of greet ?\n\n```js\nlet person = {\n  name: 'john',\n\n  age: 25,\n};\n\nfunction greet(person) {\n  person.name = `Mr ${person.name}`;\n\n  return `Welcome ${person.name}`;\n}\n\ngreet(person);\n```\n\n**3.5:** Create **higher** order function named as `transformer` which take `string` and `firstUpperCaseWord` function as an arguments. `firstUpperCaseWord` is function which make first word UpperCase from a given `String`.\n\n_[From video lecture 3.5]_\n\n**3.6:** create function which will display Your name after every 5 seconds\n\n_[From video lecture 3.8]_\n\n```js\n\ninput\n\nlet  yourName  =  \"john\";\n\n\n\noutput\n\n\"john\"  after  5  second\n\n\"john\"  after  5  second\n\n\"john\"  after  5  second\n\n\"john\"  after  5  second\n\n.\n\n.\n\n.\n\nand  so  on.\n\n```\n\n**3.7:** Guess the **Output** And Explain Why?\n\n_[From video lecture 3.4]_\n\n```js\nlet arrowFunction = (name = 'Coders') =\u003e {\n  `Welcome ${name}`;\n};\n\nconsole.log(arrowFunction('Programmers'));\n```\n\n**3.8:** Create a JavaScript **Function** to find the area of a triangle where lengths of the three of its sides are 5, 6, 7. : **Area = Square root of√s(s - a)(s - b)(s - c)** where **s** is half the perimeter, or **(a + b + c)/2**.\n\n```js\ninput: area_of_triangle(5, 6, 7);\n\noutput: 14.69;\n```\n\n**3.9:** Create a JavaScript **Function** to capitalize the first letter of each word of a given string.\n\n```js\ninput: capitalize('we are the champions');\n\noutput: 'We Are The Champions';\n```\n\n## Chapter 4 (Objects)\n\n### Assignments\n\n**4.1:** Guess the **Output** And Explain ?\n\n```js\nconsole.log(Math.round(Math.random() * 10));\n```\n\n**4.2:** Create an object called `country` for a country of your choice, containing properties `name` , `capital`, `language`, `population` and `neighbors`\n\n1. Increase the country population by two million using **dot** notation.\n2. Decrease the country population by one million using **bracket** notation.\n3. Make `language` value in Uppercase.\n\n_[From video lecture 4.1]_\n\n**4.3:** Guess the **Output** and explain Why?\n\n```js\nlet car = {\n  color: 'Blue',\n\n  model: 2021,\n\n  company: 'Toyota',\n};\n\nlet carColor = 'Blue';\n\nconsole.log(car[carColor]);\n\nconsole.log(car.carColor);\n```\n\n**4.4:** Create a method **describeCar** inside `car` object in which you have to print like this in console using template literals\n\n_[From video lecture 4.3]_\n\n**Company of my car is ** . It color is** And Model of my car is \\_\\_**\n\n**4.5:** Generate random numbers between 0 and 10 using **trunc** method of **MATH** object\n\n```js\n\nExample\n\ngetRandomNumbers(){\n\n\n\n}\n\nOuput  value  0-10\n\n```\n\n**4.6:** Guess the **Output** and Explain Why?\n\n_[From video lecture 4.4]_\n\n```js\n\nlet  arr  = [1,2,3,4];\n\narr.forEach(elem  =\u003e{\n\nif(elem  ==  1){\n\ncontinue;\n\n}\n\nconsole.log(elem);\n\n})\n\n```\n\n**4.7:** Guess the **Output** And explain Why?\n\n**Important Note**: if there is any error, How we can solve that **error**?\n\n_[From video lecture 4.7]_\n\n```js\nlet airplane = {\n  flightName: 'fly india',\n\n  atacode: 'FI',\n\n  ratings: 4.9,\n\n  book(passenger, flightNum) {\n    console.log(\n      `${passenger} Booked flight in ${this.flightName} with flight Number ${this.atacode}${flightNum}`\n    );\n  },\n};\n\nlet bookMethod = airplane.book;\n\nbookMethod('john', 8754);\n```\n\n**4.8:** Guess the **Output** And Explain Why?\n\n_[From video lecture 4.9]_\n\n```js\nlet arr = [1, 2, 3, 4];\n\nfor (let elem in arr) {\n  console.log(elem);\n}\n```\n\n**4.9:** You have to create a **Shopping_Cart** array with following features :\n\n- **addItem(itemName)** : this function should add string itemName to cart\n\n- **removeItem(itemName)**: this function should remove any item which matches itemName. _Hint : search for index of itemName and then remove it_\n\n- **cartSize()** : returns size of cart in terms of number of cart Items.\n\n## Chapter 5 (DOM)\n\n### Assignments\n\n**5.1:** Explain difference between **innerText** and **innerHTML** in the following example?\n\n_[From video lecture 5.4]_\n\n**HTML**\n\n```html\n\u003cdiv id=\"content\"\u003e\n  \u003ch2\u003eHello Coders\u003c/h2\u003e\n\u003c/div\u003e\n```\n\n**JavaScript**\n\n```js\nlet content = document.getElementById('content');\n\nconsole.log(content.innerHTML);\n\nconsole.log(content.innerText);\n```\n\n## Chapter 6 ( DOM - Forms )\n\n### Assignments\n\n**6.1:** Create regex for password with the following **validations**.\n\n1. Length of password at least of 8 characters\n\n2. contain at least one special character\n\n3. contain at least one alphabet (a-z) character\n\n_[From video lecture 6.2]_\n\n**HTML**\n\n```html\n\u003cform action=\"\" class=\"testForm\"\u003e\n  \u003cinput\n    type=\"password\"\n    name=\"\"\n    class=\"inputPass\"\n    placeholder=\"Enter Password\"\n  /\u003e\n\n  \u003cinput type=\"submit\" value=\"Check Password\" /\u003e\n\u003c/form\u003e\n```\n\n**JavaScript**\n\n```js\nlet form = document.querySelector('.testForm');\n\nlet inputPassword = document.querySelector('.inputPass');\n\nlet requiredPasswordPattern = 'create your regex here';\n\nform.addEventListener('submit', (e) =\u003e {\n  e.preventDefault();\n\n  let password = inputPassword.value;\n\n  let result = requiredPasswordPattern.test(password);\n\n  if (result == true) {\n    console.log('Your password validated successfully');\n  } else {\n    console.log('try again with new password');\n  }\n});\n```\n\n## Chapter 7 (Array Methods)\n\n### Assignments\n\n**7.1:** You have given array of **strings**. Your task is to obtain last **two** elements of given array using **slice** method?\n\n```js\nInput;\n\nlet admins = ['john', 'paul', 'Neha', 'harry'];\n\nOuput[('Neha', 'harry')];\n```\n\n**7.2:** You have given an array of **5** elements(1-5). Your task is defined as below.\n\n_[From video lecture 7.2]_\n\n```js\nconst arr = [1, 4, 7, 6, 8];\n```\n\n1. You have to delete **2** elements starting from index **2**.\n\n2. You have to add **3** new elements on index **1** choice.\n\n3. Display the **2 deleted** elements in console (from step 1)\n\n**7.3:** What happens if we use **negative** number inside **slice** method?\n\n```js\nconst arr = [1, 4, 7, 6, 8];\n```\n\nExample : arr.slice(-2);\n\n**7.4:** Write **three** different methods/approaches to get **last** element of the array?\n\n```js\nconst arr = [1, 4, 7, 6, 8];\n```\n\n_[From video lecture 7.3]_\n\n**7.5:** You have given an array of **nums**. Create new Array with the help of **nums** array. In new Array each element will be a result of **multiplication by 2** of the original array element\n\n```js\nconst arr = [1, 4, 7, 6, 8];\n```\n\n_[From video lecture 7.4]_\n\n```js\nExample: Input;\n\nlet nums = [1, 2, 3, 4, 5];\n\noutput;\n\nupdatedNums = [2, 4, 6, 8, 10];\n```\n\n**7.6** You have given an array of **scores** in which score of each student stored. Create a new array with the help of original **scores** array in which only those scores exist **greater** than 75%\n\n```js\nconst arr = [10, 40, 70, 60, 80];\n```\n\n_[From video lecture 7.5]_\n\n```js\nlet totalScore = 150;\n\nlet scores = [55, 76, 35, 77, 88, 97, 120, 136, 140];\n```\n\n**7.7:** You have given an array of numbers **nums**. You have to find **sum** of all array elements using **reduce** method?\n\n```js\nlet nums = [2, 3, 5, 7, 8, 4, 9];\n```\n\n**7.8:** You have given an array of numbers **nums**. You have to find the index of value **8** using **built-in** method of array?\n\n```js\nlet nums = [2, 3, 5, 6, 8, 6, 4, 8];\n```\n\n**7.9:** You have given an array of **objects** of users as below. Find the specified **user** with `name = \"John\" `\n\nAlso find the **position** `(index+1)` of that **user** inside the array?\n\n```js\nlet users = [\n  {\n    name: 'Paul',\n\n    age: 24,\n\n    verified: true,\n  },\n\n  {\n    name: 'John',\n\n    age: 21,\n\n    verified: false,\n  },\n\n  {\n    name: 'Neha',\n\n    age: 19,\n\n    verify: true,\n  },\n];\n```\n\n**7.10:** Guess the **Output** and explain Why?\n\n```js\nlet nums = [1, 2, 4, 5, [6, [8]], [9, 0]];\n\nlet res1 = nums.flat(1);\n\nlet res2 = nums.flatMap((elem) =\u003e elem);\n\nconsole.log(res1, res2);\n```\n\n**7.11:** You have given an array of `nums`. Write a program to `sort` the elements of array in `descending` order **using built-in** method of array.\n\n```js\nInput;\n\nlet nums = [5, 1, 4, 6, 8, 3, 9];\n\nOutput[(9, 8, 6, 5, 4, 3, 1)];\n```\n\n**7.12:** Guess the **Output** and Explain Why?\n\n_[From video lecture 7.13]_\n\n```js\nlet arr = [1, 2, 3, 4];\n\nlet result = arr.splice(1, 2).pop();\n\nconsole.log(result);\n```\n\n**7.13:** You have given an array of numbers `nums` You have to check if all elements of the **array \u003e 15** using **built-in** array method. return `true` or `false`\n\n_[From video lecture 7.9]_\n\n```js\nlet nums = [16, 17, 18, 28, 22];\n```\n\n### More Practice Questions (Arrays)\n\n**Question 1:** Guess the **Output** And explain Why?\n\n```js\nlet strArray = [1, 2, 3, 4, 5];\n\nlet result = strArray.reverse();\n\nconsole.log(result == strArray);\n```\n\n**Question 2:** You have **given** two **arrays** below as an example. Your task is to **combine** them into one By using array method\n\n```js\ninput;\n\nlet arr1 = [1, 2, 3, 4, 5];\n\nlet arr2 = [6, 7, 8, 9, 10];\n\nouput[(6, 7, 8, 9, 10, 1, 2, 3, 4, 5)];\n```\n\n**Question 3:** You have given an array of **letters** below. Convert that array into string of letters **Without Space**\n\n```js\ninput;\n\nlet arr = ['a', 'b', 'h', 'i', 's', 'h', 'e', 'k'];\n\noutput;\n\n('abhishek');\n```\n\n**Question 4:** Guess the **Output** and explain why?\n\n```js\nlet arr = [11, 62, 1, 27, 8, 5];\n\nlet sorted = arr.sort();\n\nconsole.log(sorted);\n```\n\n**Question 5:** Create a function 'calcAverageHumanAge', which accepts an arrays of dog's ages ('ages'), and does the following thing in order:\n\n1. Calculate the dog `age` in human years using the following formula: if the `dogAge \u003c= 2 years` old, `humanAge = 2 \\* dogAg`e. If the `dog is \u003e 2 years` old, `humanAge = 16 + dogAge`\n\n```js\n\nTest  data\n\n\n\nlet  arr  = [12,2,5,12,8,13,9];\n\n```\n\n**Question 6:** Guess the **Output** and Explain Why?\n\n```js\nlet arr = [1, 2, 3, 4, 5, 6, 7, 8];\n\nlet elem = arr.at(-1);\n\nconsole.log(elem);\n```\n\n**Question 7:** Guess the **Output** and Explain why?\n\n```js\nlet arr = [1, 2, 3, 4, 5, 6, 7, 8];\n\nlet result = arr.slice(2, 5).splice(0, 2, 21).pop();\n\nconsole.log(result, arr);\n```\n\n## Chapter 8 (Date)\n\n### Assignments\n\n**8.1:** How can we get current time in **millisecond** of current time?\n\n**8.2:** Guess the **Output** and Explain Why?\n\n_[From video lecture 8.2]_\n\n```js\nlet currentDate = new Date();\n\nlet result1 = currentDate.getDay();\n\nlet result2 = currentDate.getDate();\n\nconsole.log(result1, result2);\n```\n\n## Chapter 9 (LocalStorage)\n\n### Assignments\n\n**9.1:** Create two variables **myHobby** , **age** . Now **set** their value in local storage (according to your hobby and age).\n\nAfter setting also **get** value from local storage and display their values in **console**.\n\n_[From video lecture 9.2]_\n\n## Chapter 10 (OOP)\n\n### Assignments\n\n**10.1:** Your tasks:\n\n1. Use a **constructor** function to implement a `Bike`. A bike has a `make` and a `speed` property. The `speed` property is the current speed of the bike in km/h\n\n2. Implement an `accelerate` method that will increase the bike's speed by **50**, and log the new speed to the console\n\n3. Implement a `brake` method that will decrease the bike's speed by **25**, and log the new speed to the console\n\n4. Create **2** 'Bike' objects and experiment with calling `accelerate` and `brake` multiple times on each of them\n\n**Sample Data**\n\nData car 1: `bike1` going at 120 km/h\n\nData car 2: `bike` going at 95 km/h\n\n**10.2:** Re-create **Question 1** But this time using **ES6**\n\nclass.\n\n_[From video lecture 10.4]_\n\n**10.3:** Guess the **Output** And Explain Why?\n\n_[From video lecture 10.2]_\n\n```js\nfunction Person(name) {\n  this.name = name;\n}\n\nlet me = new Person('John');\n\nconsole.log(me.__proto__ == Person.prototype);\n\nconsole.log(me.__proto__.__proto__ == Object.prototype);\n```\n\n**10.4:** Create **constructor** function inside **Car** class with three properties **color** , **model** , **company**\n\n```js\nclass Car {}\n```\n\n**10.5:** **Identify** all **mistakes** in the following class\n\n```js\n\nclass  Car = {\n\nconstructor(){\n\n\n\n},\n\nengineMethod  =  function(){\n\nconsole.log(\"This is engine method of Car class\");\n\n}\n\n}\n\n```\n\n**10.6:** Guess the **Output** and explain Why? And **if** there is any **error** How we can remove that error?\n\n_[From video lecture 10.6]_\n\n```js\nfunction Person(name, age) {\n  this.name = name;\n\n  this.age = age;\n\n  this.brainMethod = function () {\n    console.log('This is brain method of Person');\n  };\n}\n\nPerson.heartMethod = function () {\n  console.log('This is heart method of Person');\n};\n\nlet me = new Person('john', 34);\n\nme.brainMethod();\n\nme.heartMethod();\n```\n\n**10.7:** Create a new class `Dog` (which will be child class) inherited from `Animal` class. In Addition in `Dog` class add some additional properties like **breedType**\n\n_[From video lecture 10.7]_\n\n**Question 8:** Guess the **Output** And Explain Why?\n\n```js\nclass Car {\n  constructor() {}\n}\n\nlet car = new Car();\n\nconsole.log(Car.prototype.isPrototypeOf(Car));\n\nconsole.log(Car.prototype.isPrototypeOf(car));\n```\n\n### More Practice Questions (OOP)\n\n**Question 1:** Guess the **Output** and Explain Why?\n\n```js\nfunction carObject(name, model) {\n  let car = Object.create(constructorObject);\n\n  car.name = name;\n\n  car.model = model;\n\n  this.engineMethod = function () {\n    console.log('This is engine method of car');\n  };\n\n  return car;\n}\n\nlet constructorObject = {\n  speak: function () {\n    return 'This is my car';\n  },\n};\n\nlet myCar = carObject('Audi', 2023);\n\nconsole.log(myCar.__proto__);\n```\n\n**Question 2:** You have given an example of **OOP** Code. Your task is to explain the use of `super` keyword in `Dog` class.\n\nAnd you have to **change** the code again after removing `super` keyword from the `Dog` class (You have remove those lines/statements which are not **necessary** after **removing** super **keyword**)\n\n```js\nclass Animals {\n  constructor(name, age) {\n    this.name = name;\n\n    this.age = age;\n  }\n\n  sing() {\n    return `${this.name} can sing`;\n  }\n\n  dance() {\n    return `${this.name} can dance`;\n  }\n}\n\nclass Dogs extends Animals {\n  constructor(name, age, whiskerColor) {\n    super(name, age);\n\n    this.whiskerColor = whiskerColor;\n  }\n\n  whiskers() {\n    return `I have ${this.whiskerColor} whiskers`;\n  }\n}\n\nlet newDog = new Dogs('Clara', 33, 'indigo');\n\nconsole.log(newDog);\n```\n\n**Question 3:** What are the advantages of using **getter** and **setter** method in OOP?\n\n**Question 4:** You have OOP code below. And there is **single** error in this code? Your task is to **remove that error**.\n\n**Important Note**: To solve this error You need to know about **method chaining** concept.\n\n```js\nclass Car {\n  constructor(id) {\n    this.id = id;\n  }\n\n  setMake(make) {\n    this.make = make;\n  }\n\n  setModel(model) {\n    this.model = model;\n  }\n\n  setFuelType(fuelType) {\n    this.fuelType = fuelType;\n  }\n\n  getCarInfo() {\n    return {\n      id: this.id,\n\n      make: this.make,\n\n      model: this.model,\n\n      fuelType: this.fuelType,\n    };\n  }\n}\n\nconsole.log(\n  new Car(233)\n\n    .setMake('Honda')\n\n    .setModel('Civic')\n\n    .setFuelType('Petrol')\n\n    .getCarInfo()\n);\n```\n\n**Question 5:** What is difference between ** proto** and prototype property of Object? Try with **Example**?\n\n**Question 6:** create class of `Person` with properties `name`, `age`.\n\nYour main task is to add `static` method in that class of your choice ( e.g brainMethod)\n\n```js\nclass Person {\n  constructor(name, age) {\n    this.name = name;\n\n    this.age = age;\n  }\n}\n\nlet me = new Person('abhishek', 25);\n\nconsole.log(me);\n```\n\n## Chapter 11( Async Js )\n\n### Assignments\n\n**11.1:** Guess the **Output** And Explain Why?\n\n_[From video lecture 11.7]_\n\n**Html Code**\n\n```html\n\n\u003c!DOCTYPE  html\u003e\n\n\u003chtml  lang=\"en\"\u003e\n\n\u003chead\u003e\n\n\u003cmeta  charset=\"UTF-8\"\u003e\n\n\u003cmeta  http-equiv=\"X-UA-Compatible\"  content=\"IE=edge\"\u003e\n\n\u003cmeta  name=\"viewport\"  content=\"width=device-width, initial-scale=1.0\"\u003e\n\n\u003ctitle\u003eJavaScript-CoderDost\u003c/title\u003e\n\n\u003cstyle\u003e\n\n\u003c/head\u003e\n\n\u003cbody\u003e\n\n\u003cdiv id=\"content\"\u003e\n\n\n\n\u003ch2 id = \"heading\" \u003e\u003c/h2\u003e\n\n\n\n\u003c/div\u003e\n\n\u003cscript defer src = \"./script.js\"\u003e\u003c/script\u003e\n\n\u003c/script\u003e\n\n\u003c/body\u003e\n\n\u003c/html\u003e\n\n```\n\n**JS Code**\n\n```js\nasync function greeting() {\n  let myPromise = new Promise(function (resolve) {\n    setTimeout(function () {\n      resolve('I love Programming !!');\n    }, 2000);\n  });\n\n  document.getElementById('heading').innerHTML = await myPromise;\n}\n\ngreeting();\n```\n\n**11.2:** Find the **Logical Error** in below code. And How can we solve them with **callback** function approach?\n\n_[From video lecture 11.4]_\n\n```js\nconst movies = [{ title: `Movie 1` }, { title: `Movie 2` }];\n\nfunction getMovies() {\n  setTimeout(() =\u003e {\n    movies.forEach((movie, index) =\u003e {\n      console.log(movie.title);\n    });\n  }, 1000);\n}\n\nfunction createMovies(movie) {\n  setTimeout(() =\u003e {\n    movies.push(movie);\n  }, 2000);\n}\n\ngetMovies();\n\ncreateMovies({ title: `Movie 3` });\n```\n\n**11.3:** What are the **three** possible State of any promise?\n\n**11.4:** Solve **Question 2** again But this time with the help of **promise**\n\n**11.5:** Now re-factor **Question 2** with the help of **async-await** keyword?\n\n**11.6:** Status code starting with **404** represent which type of message/error?\n\n_[From video lecture 11.3]_\n\n## Chapter 12 (ES6)\n\n### Assignments\n\n**12.1:** Guess the **Output** and Explain Why?\n\n_[From video lecture 12.1]_\n\n```js\nlet arr = [3, 4, 5, 7, 98, 0];\n\nlet [a, b, , c] = arr;\n\nconsole.log(a, b, c);\n```\n\n**12.2:** Guess the **Output** And Explain Why?\n\n_[From video lecture 12.1]_\n\n```js\nlet arr = [1, 3, [2, 55], [9, 8, 7]];\n\nlet [a, , [b, c], d] = arr;\n\nconsole.log(a, b, c, d);\n```\n\n**12.3:** Guess the **Output** and explain Why?\n\n_[From video lecture 12.2]_\n\n```js\nlet obj = {\n  name: 'John',\n\n  age: 25,\n\n  weight: 70,\n};\n\nlet { name: objName, age } = obj;\n\nconsole.log(name, age);\n```\n\n**12.4:** You have given an array of **nums**.Create **shallow** copy of that array and store them in another **variable**\n\n_[From video lecture 12.3]_\n\n```js\n\nlet  nums  = [5,7,4,9,2,8];\n\n\n\nlet  newNums  =  \"store Shallow copy of nums inside newNums variable\")\n\n```\n\n**12.5:** You have given an array as below . Create a function which accept **multiple** elements as an argument and return last **4** element of the array\n\n_[From video lecture 12.4]_\n\n```js\n\nExample:\n\nlet  nums  = [1,2,3,4,5,6,7,8];\n\ninput data: 1,2,3,4,5,6,7,8\n\noutput data: 5,6,7,8\n\n```\n\n**12.6:** Guess the **Output** And Explain Why?\n\n_[From video lecture 12.6]_\n\n```js\nlet nums = 0;\n\nlet result = nums ?? 50;\n\nconsole.log(result);\n```\n\n**12.7:** You have given an object as below. You have to check wheather **physics** is the subject of that student or not, if true find the **score** of **physics** subject using **optional chaining**\n\n```js\nlet student = {\n  Math: {\n    score: 75,\n  },\n\n  physics: {\n    score: 85,\n  },\n};\n```\n\n**12.8:** Guess the **Output** And Explain Why?\n\n_[From video lecture 12.7]_\n\n```js\nlet nums = [2, 3, 4, 5, 6];\n\nfor (let key of nums) {\n  console.log(key);\n}\n```\n\n### More Practice Questions\n\n**Question 1:** Guess the **Output** and Explain Why?\n\n```js\nlet arr = [1, 2, 3, 4, 5];\n\nlet arr1 = [...arr];\n\narr1[2] = 10;\n\nconsole.log(arr, arr1);\n```\n\n**Question 2:** You have given a list of variable names written in underscore. You have to write a program to convert them into camel casing format\n\n```js\n\nList  of  variable  names\n\n\n\nInput\n\nuser_name\n\nlast_name\n\ndate_of_birth\n\nuser_password\n\n\n\nOutput\n\nuserName\n\nlastName\n\ndateOfBirth\n\nuserPassword\n\n```\n\n**Question 3:** Guess the **Output** and Explain why?\n\n```js\nfunction fun(a, b, ...c) {\n  console.log(`${a}  ${b}`);\n\n  console.log(c);\n\n  console.log(c[0]);\n\n  console.log(c.length);\n\n  console.log(c.indexOf('google'));\n}\n\nfun('apple', 'sumsung', 'amazon', 'google', 'facebook');\n```\n\n**Question 4:** Guess the **Output** and Explain Why?\n\n```js\nconst fruits = { apple: 8, orange: 7, pear: 5 };\n\nconst entries = Object.entries(fruits);\n\nfor (const [fruit, count] of entries) {\n  console.log(`There are ${count}  ${fruit}s`);\n}\n```\n\n**Question 5:** Write a program in which you have to set **Default** value in case of false input value using **Logical Assignment** Operator?\n\n**Question 6:** Guess the **Output** and Explain Why?\n\n```js\nlet arr = new Set([1, 2, 3, 1, 2, 1, 3, 4, 6, 7, 5]);\n\nlet length = arr.size;\n\nconsole.log(arr, length);\n```\n\n**Question 7:** You have given **Set** below. Your task is to convert that **Set** into an **array**?\n\n```js\ninput;\n\nlet set = new Set[(1, 2, 3, 2, 1, 3, 4, 12, 2)]();\n\noutput;\n\nlet arr = 'Do something here to convert....';\n```\n\n**Question 8:** Guess the **Output** and Explain Why?\n\n**Note** : **Change** values of variable to examine the result.\n\n```js\nlet number = 40;\n\nlet age = 18;\n\nlet result = number \u003e 50 ? (age \u003e 19 ? 'pass' : 'ageIssue') : 'numberIssue';\n\nconsole.log(result);\n```\n\n## Chapter 13 (Modern Tooling)\n\n### Assignments\n\n**13.1:** You have given scenario. You are in **script.js** And in same directory there is another file **products.js**. In **products.js** there are two methods called **createProduct** and **deleteProduct**\n\n- write an **import** and **export** statement properly in order to import these two methods from **products.js** file into the **script.js**\n\n**Question 2** Now **export** only one method **createProduct** using **default** export statement?\n\n**Question 3:** In **import** statement how can we **customize**/**change** the name of **function** we are importing?\n\nExample : function is defined as `Addition`. We want to import as 'Add'\n\nHow can can we do this?\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderdost%2Fjavascript-course-2023","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderdost%2Fjavascript-course-2023","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderdost%2Fjavascript-course-2023/lists"}