diff --git a/01_Day_Introduction/01_day_starter/index.html b/01_Day_Introduction/01_day_starter/index.html index 6684bc94..7ed5b19b 100644 --- a/01_Day_Introduction/01_day_starter/index.html +++ b/01_Day_Introduction/01_day_starter/index.html @@ -11,7 +11,7 @@ - + diff --git a/01_Day_Introduction/01_day_starter/varaible.js b/01_Day_Introduction/01_day_starter/variable.js similarity index 100% rename from 01_Day_Introduction/01_day_starter/varaible.js rename to 01_Day_Introduction/01_day_starter/variable.js diff --git a/02_Day_Data_types/02_day_data_types.md b/02_Day_Data_types/02_day_data_types.md index 198ae2b2..1d7908c8 100644 --- a/02_Day_Data_types/02_day_data_types.md +++ b/02_Day_Data_types/02_day_data_types.md @@ -19,30 +19,30 @@ ![Thirty Days Of JavaScript](../images/banners/day_1_2.png) - [πŸ“” Day 2](#-day-2) - - [Data Types](#data-types) - - [Primitive Data Types](#primitive-data-types) - - [Non-Primitive Data Types](#non-primitive-data-types) - - [Numbers](#numbers) - - [Declaring Number Data Types](#declaring-number-data-types) - - [Math Object](#math-object) - - [Random Number Generator](#random-number-generator) - - [Strings](#strings) - - [String Concatenation](#string-concatenation) - - [Concatenating Using Addition Operator](#concatenating-using-addition-operator) - - [Long Literal Strings](#long-literal-strings) - - [Escape Sequences in Strings](#escape-sequences-in-strings) - - [Template Literals (Template Strings)](#template-literals-template-strings) - - [String Methods](#string-methods) - - [Checking Data Types and Casting](#checking-data-types-and-casting) - - [Checking Data Types](#checking-data-types) - - [Changing Data Type (Casting)](#changing-data-type-casting) - - [String to Int](#string-to-int) - - [String to Float](#string-to-float) - - [Float to Int](#float-to-int) - - [πŸ’» Day 2: Exercises](#-day-2-exercises) - - [Exercise: Level 1](#exercise-level-1) - - [Exercise: Level 2](#exercise-level-2) - - [Exercises: Level 3](#exercises-level-3) + - [Data Types](#data-types) + - [Primitive Data Types](#primitive-data-types) + - [Non-Primitive Data Types](#non-primitive-data-types) + - [Numbers](#numbers) + - [Declaring Number Data Types](#declaring-number-data-types) + - [Math Object](#math-object) + - [Random Number Generator](#random-number-generator) + - [Strings](#strings) + - [String Concatenation](#string-concatenation) + - [Concatenating Using Addition Operator](#concatenating-using-addition-operator) + - [Long Literal Strings](#long-literal-strings) + - [Escape Sequences in Strings](#escape-sequences-in-strings) + - [Template Literals (Template Strings)](#template-literals-template-strings) + - [String Methods](#string-methods) + - [Checking Data Types and Casting](#checking-data-types-and-casting) + - [Checking Data Types](#checking-data-types) + - [Changing Data Type (Casting)](#changing-data-type-casting) + - [String to Int](#string-to-int) + - [String to Float](#string-to-float) + - [Float to Int](#float-to-int) + - [πŸ’» Day 2: Exercises](#-day-2-exercises) + - [Exercise: Level 1](#exercise-level-1) + - [Exercise: Level 2](#exercise-level-2) + - [Exercises: Level 3](#exercises-level-3) # πŸ“” Day 2 @@ -876,7 +876,7 @@ console.log(numFloat) // 9.81 let num = '9.81' let numFloat = +num -console.log(numInt) // 9.81 +console.log(numFloat) // 9.81 ``` #### Float to Int diff --git a/03_Day_Booleans_operators_date/03_booleans_operators_date.md b/03_Day_Booleans_operators_date/03_booleans_operators_date.md index ec847c50..72f61011 100644 --- a/03_Day_Booleans_operators_date/03_booleans_operators_date.md +++ b/03_Day_Booleans_operators_date/03_booleans_operators_date.md @@ -18,38 +18,38 @@ ![Thirty Days Of JavaScript](../images/banners/day_1_3.png) - [πŸ“” Day 3](#-day-3) - - [Booleans](#booleans) - - [Truthy values](#truthy-values) - - [Falsy values](#falsy-values) - - [Undefined](#undefined) - - [Null](#null) - - [Operators](#operators) - - [Assignment operators](#assignment-operators) - - [Arithmetic Operators](#arithmetic-operators) - - [Comparison Operators](#comparison-operators) - - [Logical Operators](#logical-operators) - - [Increment Operator](#increment-operator) - - [Decrement Operator](#decrement-operator) - - [Ternary Operators](#ternary-operators) - - [Operator Precendence](#operator-precendence) - - [Window Methods](#window-methods) - - [Window alert() method](#window-alert-method) - - [Window prompt() method](#window-prompt-method) - - [Window confirm() method](#window-confirm-method) - - [Date Object](#date-object) - - [Creating a time object](#creating-a-time-object) - - [Getting full year](#getting-full-year) - - [Getting month](#getting-month) - - [Getting date](#getting-date) - - [Getting day](#getting-day) - - [Getting hours](#getting-hours) - - [Getting minutes](#getting-minutes) - - [Getting seconds](#getting-seconds) - - [Getting time](#getting-time) - - [πŸ’» Day 3: Exercises](#-day-3-exercises) - - [Exercises: Level 1](#exercises-level-1) - - [Exercises: Level 2](#exercises-level-2) - - [Exercises: Level 3](#exercises-level-3) + - [Booleans](#booleans) + - [Truthy values](#truthy-values) + - [Falsy values](#falsy-values) + - [Undefined](#undefined) + - [Null](#null) + - [Operators](#operators) + - [Assignment operators](#assignment-operators) + - [Arithmetic Operators](#arithmetic-operators) + - [Comparison Operators](#comparison-operators) + - [Logical Operators](#logical-operators) + - [Increment Operator](#increment-operator) + - [Decrement Operator](#decrement-operator) + - [Ternary Operators](#ternary-operators) + - [Operator Precendence](#operator-precendence) + - [Window Methods](#window-methods) + - [Window alert() method](#window-alert-method) + - [Window prompt() method](#window-prompt-method) + - [Window confirm() method](#window-confirm-method) + - [Date Object](#date-object) + - [Creating a time object](#creating-a-time-object) + - [Getting full year](#getting-full-year) + - [Getting month](#getting-month) + - [Getting date](#getting-date) + - [Getting day](#getting-day) + - [Getting hours](#getting-hours) + - [Getting minutes](#getting-minutes) + - [Getting seconds](#getting-seconds) + - [Getting time](#getting-time) + - [πŸ’» Day 3: Exercises](#-day-3-exercises) + - [Exercises: Level 1](#exercises-level-1) + - [Exercises: Level 2](#exercises-level-2) + - [Exercises: Level 3](#exercises-level-3) # πŸ“” Day 3 @@ -218,7 +218,7 @@ console.log('python'.length > 'dragon'.length) // false ``` Try to understand the above comparisons with some logic. Remembering without any logic might be difficult. -JavaScript is some how a wired kind of programming language. JavaScript code run and give you a result but unless you are good at it may not be the desired result. +JavaScript is somehow a wired kind of programming language. JavaScript code run and give you a result but unless you are good at it may not be the desired result. As rule of thumb, if a value is not true with == it will not be equal with ===. Using === is safer than using ==. The following [link](https://dorey.github.io/JavaScript-Equality-Table/) has an exhaustive list of comparison of data types. @@ -254,7 +254,7 @@ let isMarried = !false // true ### Increment Operator -In JavaScrip we use the increment operator to increase a value stored in a variable. The increment could be pre or post increment. Let us see each of them: +In JavaScript we use the increment operator to increase a value stored in a variable. The increment could be pre or post increment. Let us see each of them: 1. Pre-increment @@ -276,7 +276,7 @@ We use most of the time post-increment. At least you should remember how to use ### Decrement Operator -In JavaScrip we use the decrement operator to decrease a value stored in a variable. The decrement could be pre or post decrement. Let us see each of them: +In JavaScript we use the decrement operator to decrease a value stored in a variable. The decrement could be pre or post decrement. Let us see each of them: 1. Pre-decrement diff --git a/04_Day_Conditionals/04_day_conditionals.md b/04_Day_Conditionals/04_day_conditionals.md index b2a935a8..93ca3eaf 100644 --- a/04_Day_Conditionals/04_day_conditionals.md +++ b/04_Day_Conditionals/04_day_conditionals.md @@ -18,16 +18,16 @@ ![Thirty Days Of JavaScript](../images/banners/day_1_4.png) - [πŸ“” Day 4](#-day-4) - - [Conditionals](#conditionals) - - [If](#if) - - [If Else](#if-else) - - [If Else if Else](#if-else-if-else) - - [Switch](#switch) - - [Ternary Operators](#ternary-operators) - - [πŸ’» Exercises](#-exercises) - - [Exercises: Level 1](#exercises-level-1) - - [Exercises: Level 2](#exercises-level-2) - - [Exercises: Level 3](#exercises-level-3) + - [Conditionals](#conditionals) + - [If](#if) + - [If Else](#if-else) + - [If Else if Else](#if--else-if-else) + - [Switch](#switch) + - [Ternary Operators](#ternary-operators) + - [πŸ’» Exercises](#-exercises) + - [Exercises: Level 1](#exercises-level-1) + - [Exercises: Level 2](#exercises-level-2) + - [Exercises: Level 3](#exercises-level-3) # πŸ“” Day 4 @@ -189,7 +189,8 @@ switch(caseValue){ // code break case 3: - // code + // code + break default: // code } diff --git a/09_Day_Higher_order_functions/09_day_higher_order_functions.md b/09_Day_Higher_order_functions/09_day_higher_order_functions.md index a6aef3bf..3526916c 100644 --- a/09_Day_Higher_order_functions/09_day_higher_order_functions.md +++ b/09_Day_Higher_order_functions/09_day_higher_order_functions.md @@ -390,7 +390,7 @@ _every_: Check if all the elements are similar in one aspect. It returns boolean const names = ['Asabeneh', 'Mathias', 'Elias', 'Brook'] const areAllStr = names.every((name) => typeof name === 'string') // Are all strings? -console.log(arrAllStr) +console.log(areAllStr) ``` ```sh diff --git a/12_Day_Regular_expressions/12_day_regular_expressions.md b/12_Day_Regular_expressions/12_day_regular_expressions.md index 99d85f0f..adf91c48 100644 --- a/12_Day_Regular_expressions/12_day_regular_expressions.md +++ b/12_Day_Regular_expressions/12_day_regular_expressions.md @@ -18,29 +18,29 @@ ![Thirty Days Of JavaScript](../images/banners/day_1_12.png) - [πŸ“˜ Day 12](#-day-12) - - [Regular Expressions](#regular-expressions) - - [RegExp parameters](#regexp-parameters) - - [Pattern](#pattern) - - [Flags](#flags) - - [Creating a pattern with RegExp Constructor](#creating-a-pattern-with-regexp-constructor) - - [Creating a pattern without RegExp Constructor](#creating-a-pattern-without-regexp-constructor) - - [RegExpp Object Methods](#regexpp-object-methods) - - [Testing for a match](#testing-for-a-match) - - [Array containing all of the match](#array-containing-all-of-the-match) - - [Replacing a substring](#replacing-a-substring) - - [Square Bracket](#square-bracket) - - [Escape character(\\) in RegExp](#escape-character-in-regexp) - - [One or more times(+)](#one-or-more-times) - - [Period(.)](#period) - - [Zero or more times(*)](#zero-or-more-times) - - [Zero or one times(?)](#zero-or-one-times) - - [Quantifier in RegExp](#quantifier-in-regexp) - - [Cart ^](#cart-) - - [Exact match](#exact-match) - - [πŸ’» Exercises](#-exercises) - - [Exercises: Level 1](#exercises-level-1) - - [Exercises: Level 2](#exercises-level-2) - - [Exercises: Level 3](#exercises-level-3) + - [Regular Expressions](#regular-expressions) + - [RegExp parameters](#regexp-parameters) + - [Pattern](#pattern) + - [Flags](#flags) + - [Creating a pattern with RegExp Constructor](#creating-a-pattern-with-regexp-constructor) + - [Creating a pattern without RegExp Constructor](#creating-a-pattern-without-regexp-constructor) + - [RegExpp Object Methods](#regexpp-object-methods) + - [Testing for a match](#testing-for--a-match) + - [Array containing all of the match](#array-containing-all-of-the-match) + - [Replacing a substring](#replacing-a-substring) + - [Square Bracket](#square-bracket) + - [Escape character(\\) in RegExp](#escape-character-in-regexp) + - [One or more times(+)](#one-or-more-times) + - [Period(.)](#period) + - [Zero or more times(*)](#zero-or-more-times) + - [Zero or one times(?)](#zero-or-one-times) + - [Quantifier in RegExp](#quantifier-in-regexp) + - [Cart ^](#cart-) + - [Exact match](#exact-match) + - [πŸ’» Exercises](#-exercises) + - [Exercises: Level 1](#exercises-level-1) + - [Exercises: Level 2](#exercises-level-2) + - [Exercises: Level 3](#exercises-level-3) # πŸ“˜ Day 12 @@ -503,22 +503,19 @@ distance = 12 ```js sentence = `%I $am@% a %tea@cher%, &and& I lo%#ve %tea@ching%;. There $is nothing; &as& mo@re rewarding as educa@ting &and& @emp%o@wering peo@ple. ;I found tea@ching m%o@re interesting tha@n any other %jo@bs. %Do@es thi%s mo@tivate yo@u to be a tea@cher!?` - - console.log(cleanText(sentence)) + console.log(cleanText(sentence)) ``` ```sh I am a teacher and I love teaching There is nothing as more rewarding as educating and empowering people I found teaching more interesting than any other jobs Does this motivate you to be a teacher ``` -1. Write a function which find the most frequent words. After cleaning, count three most frequent words in the string. +2. Write a function which find the most frequent words. After cleaning, count three most frequent words in the string. - ```js + ```js console.log(mostFrequentWords(cleanedText)) [{word:'I', count:3}, {word:'teaching', count:2}, {word:'teacher', count:2}] - ``` - + ``` πŸŽ‰ CONGRATULATIONS ! πŸŽ‰ - -[<< Day 11](../11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md) | [Day 13>>](../13_Day_Console_object_methods/13_day_console_object_methods.md) +[<< Day 11](../11_Day_Destructuring_and_spreading/11_day_destructuring_and_spreading.md) | [Day 13 >>](../13_Day_Console_object_methods/13_day_console_object_methods.md) diff --git a/15_Day_Classes/15_day_classes.md b/15_Day_Classes/15_day_classes.md index 7b463289..7d469bf2 100644 --- a/15_Day_Classes/15_day_classes.md +++ b/15_Day_Classes/15_day_classes.md @@ -19,22 +19,22 @@ ![Thirty Days Of JavaScript](../images/banners/day_1_15.png) - [Day 15](#day-15) - - [Classes](#classes) - - [Defining a classes](#defining-a-classes) - - [Class Instantiation](#class-instantiation) - - [Class Constructor](#class-constructor) - - [Default values with constructor](#default-values-with-constructor) - - [Class methods](#class-methods) - - [Properties with initial value](#properties-with-initial-value) - - [getter](#getter) - - [setter](#setter) - - [Static method](#static-method) - - [Inheritance](#inheritance) - - [Overriding methods](#overriding-methods) - - [Exercises](#exercises) - - [Exercises Level 1](#exercises-level-1) - - [Exercises Level 2](#exercises-level-2) - - [Exercises Level 3](#exercises-level-3) + - [Classes](#classes) + - [Defining a classes](#defining-a-classes) + - [Class Instantiation](#class-instantiation) + - [Class Constructor](#class-constructor) + - [Default values with constructor](#default-values-with-constructor) + - [Class methods](#class-methods) + - [Properties with initial value](#properties-with-initial-value) + - [getter](#getter) + - [setter](#setter) + - [Static method](#static-method) + - [Inheritance](#inheritance) + - [Overriding methods](#overriding-methods) + - [Exercises](#exercises) + - [Exercises Level 1](#exercises-level-1) + - [Exercises Level 2](#exercises-level-2) + - [Exercises Level 3](#exercises-level-3) # Day 15 @@ -111,7 +111,7 @@ console.log(person) ``` ```sh -PersonΒ {firstName: undefined, lastName} +PersonΒ {firstName: undefined, lastName:undefined} ``` All the keys of the object are undefined. When ever we instantiate we should pass the value of the properties. Let us pass value at this time when we instantiate the class. diff --git a/18_Day_Promises/18_day_promises.md b/18_Day_Promises/18_day_promises.md index fe0dac7b..bfe5b39d 100644 --- a/18_Day_Promises/18_day_promises.md +++ b/18_Day_Promises/18_day_promises.md @@ -19,15 +19,15 @@ ![Thirty Days Of JavaScript](../images/banners/day_1_18.png) - [Day 18](#day-18) - - [Promise](#promise) - - [Callbacks](#callbacks) - - [Promise constructor](#promise-constructor) - - [Fetch API](#fetch-api) - - [Async and Await](#async-and-await) - - [Exercises](#exercises) - - [Exercises: Level 1](#exercises-level-1) - - [Exercises: Level 2](#exercises-level-2) - - [Exercises: Level 3](#exercises-level-3) + - [Promise](#promise) + - [Callbacks](#callbacks) + - [Promise constructor](#promise-constructor) + - [Fetch API](#fetch-api) + - [Async and Await](#async-and-await) + - [Exercises](#exercises) + - [Exercises: Level 1](#exercises-level-1) + - [Exercises: Level 2](#exercises-level-2) + - [Exercises: Level 3](#exercises-level-3) # Day 18 @@ -147,7 +147,7 @@ Let us another example when the promise is settled with reject. const doPromise = new Promise((resolve, reject) => { setTimeout(() => { const skills = ['HTML', 'CSS', 'JS'] - if (skills.icludes('Node')) { + if (skills.includes('Node')) { resolve('fullstack developer') } else { reject('Something wrong has happened') diff --git a/21_Day_DOM/21_day_dom.md b/21_Day_DOM/21_day_dom.md index cc1baf60..84c95d4f 100644 --- a/21_Day_DOM/21_day_dom.md +++ b/21_Day_DOM/21_day_dom.md @@ -74,7 +74,7 @@ We can access already created element or elements using JavaScript. To access or #### Getting elements by tag name -**_getElementsByTagName()_**:takes a take name as a string parameter and this method returns an HTMLCollection object. An HTMLCollection is an array like object of HTML elements. The length property provides the size of the collection. Whenever we use this method we access the individual elements using index or after loop through each individual items. An HTMLCollection does not support all array methods therefore we should use regular for loop instead of forEach. +**_getElementsByTagName()_**:takes a tag name as a string parameter and this method returns an HTMLCollection object. An HTMLCollection is an array like object of HTML elements. The length property provides the size of the collection. Whenever we use this method we access the individual elements using index or after loop through each individual items. An HTMLCollection does not support all array methods therefore we should use regular for loop instead of forEach. ```js // syntax diff --git a/readMe.md b/readMe.md index 2455f669..c7020782 100644 --- a/readMe.md +++ b/readMe.md @@ -240,7 +240,7 @@ This is a multiline comment ##### Syntax -Programming languages are similar to human languages. English or many other language uses words, phrases, sentences,compound sentences and other more to convey a meaningful message. The English meaning of syntax is _the arrangement of words and phrases to create well-formed sentences in a language_. The technical definition of syntax is the structure of statements in a computer language.Programming languages have syntax. JavaScript is a programming language and like other programming languages it has its own syntax. If we do not write a syntax that JavaScript understands, it will raise different types of errors. We will explore different kinds of JavaScript errors later. For now, let us see syntax errors. +Programming languages are similar to human languages. English or many other language uses words, phrases, sentences, compound sentences and other more to convey a meaningful message. The English meaning of syntax is _the arrangement of words and phrases to create well-formed sentences in a language_. The technical definition of syntax is the structure of statements in a computer language. Programming languages have syntax. JavaScript is a programming language and like other programming languages it has its own syntax. If we do not write a syntax that JavaScript understands, it will raise different types of errors. We will explore different kinds of JavaScript errors later. For now, let us see syntax errors. ![Error](images/raising_syntax_error.png)