├── .gitattributes ├── curriculum_template.js ├── readme.md └── curriculum.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /curriculum_template.js: -------------------------------------------------------------------------------- 1 | // 1.0 Intro 2 | // -- What is JavaScript and how does it work? 3 | // -- Install VSCode 4 | // -- Install NodeJS 5 | 6 | // 2.0 Node commands in terminal - (Ctrl + `) to open terminal 7 | // -- Running a file 8 | // -- Killing a file 9 | 10 | // 3.0 Variables 11 | // -- Hello world 12 | // -- Console.log() 13 | // -- Variables 14 | // -- Code comments 15 | // -- Assignment by reference 16 | 17 | // 4.0 Data Types (init / read / write) 18 | // -- Strings 19 | // -- Numbers 20 | // -- Arrays 21 | // -- Objects 22 | // -- Null 23 | // -- Undefined 24 | // -- Booleans (true/false) 25 | 26 | // 5.0 Recap 27 | 28 | // 6.0 Logic and Operators 29 | // -- Operators (+ - / %) 30 | // -- Logical operators (|| &&) 31 | // -- Type of 32 | 33 | // 7.0 Conditional Statements 34 | // -- If else 35 | 36 | // 8.0 Loops 37 | // -- While loop 38 | // -- For loop 39 | // -- Continue & break 40 | 41 | // 9.0 Functions 42 | // -- Create a function 43 | // -- Invoke a function 44 | // -- Return 45 | // -- Default inputs 46 | // -- Arrow functions -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # JavaScript Beginner Course 2 | 3 | ## Get Started with JavaScript in 2 Hours 🔥 4 | 5 | Welcome my friends to this **JavaScript For Beginners** course that I am super excited to have live on the [YouTube channel](https://www.youtube.com/smoljames)! 6 | 7 | **This beginner course is suitable for you if:** 8 | 9 | ✅ You have no experience with JavaScript and want to get started 10 | ✅ Have dabbled with JavaScript but want to improve your foundational understanding 11 | ✅ Want to feel confident and comfortable coding in the JavaScript ecosystem 12 | ✅ Set yourself up with the skills and knowledge you need to eventually become a JavaScript master 13 | 14 | The course is self is specifically designed to be easy and efficient, and saves you from spending 10+ hours just to learn the basics and get up and running. We achieve this by following a curriculum teaches you the 20% of material that does 80% of the leg work, so you can start coding in JavaScript as soon as possible! 15 | 16 | If you enjoy the course, be sure to check out the full version which contains **9 hours of material, numerous practice questions and examples, and also 5 unique and exciting portfolio projects**. 17 | 18 | * [The Complete JavaScript Course](https://www.udemy.com/course/the-complete-javascript-course-zero-to-hero/?referralCode=F6229ABBDBD16EB43FA4) 19 | 20 | ## How to Begin 21 | 22 | You can get started with this course totally for free by click the YouTube link below ⬇️ 23 | 24 | * [JavaScript Beginner Course | Get Started with JavaScript in 2 Hours](https://youtu.be/-ihpNX0EODc) 25 | 26 | To complete the course, you need **not** have any experience with JavaScript. We start from the very beginnering. 27 | 28 | It is recommend that you download the JavaScript curriculum file which can be found [here](https://github.com/jamezmca/javascript-for-beginners/blob/main/curriculum_template.js). 29 | 30 | ## The JavaScript Beginner Course Curriculum 31 | 32 | As mentioned above, this curriculum is designed to teach you all the foundational concepts and knowledge you need to start your journey to becoming a JavaScript pro. 33 | 34 | ### 1.0 Introduction 35 | - **What is JavaScript and how does it work?** 36 | - **Install VSCode** 37 | - **Install NodeJS** 38 | 39 | ### 2.0 Node Commands in Terminal 40 | - **Opening the Terminal**: Use (Ctrl + `) to open the terminal. 41 | - **Running a File** 42 | - **Killing a File** 43 | 44 | ### 3.0 Variables 45 | - **Hello World** 46 | - **Using `console.log()`** 47 | - **Variables** 48 | - **Code Comments** 49 | - **Assignment by Reference** 50 | 51 | ### 4.0 Data Types (Initialization / Reading / Writing) 52 | - **Strings** 53 | - **Numbers** 54 | - **Arrays** 55 | - **Objects** 56 | - **Null** 57 | - **Undefined** 58 | - **Booleans (true/false)** 59 | 60 | ### 5.0 Recap 61 | 62 | ### 6.0 Logic and Operators 63 | - **Operators**: `+`, `-`, `/`, `%` 64 | - **Logical Operators**: `||`, `&&` 65 | - **`typeof` Operator** 66 | 67 | ### 7.0 Conditional Statements 68 | - **If-Else Statements** 69 | 70 | ### 8.0 Loops 71 | - **While Loop** 72 | - **For Loop** 73 | - **Continue & Break Statements** 74 | 75 | ### 9.0 Functions 76 | - **Creating a Function** 77 | - **Invoking a Function** 78 | - **Return Statement** 79 | - **Default Parameters** 80 | - **Arrow Functions** 81 | 82 | If you enjoy the course, be sure to ⭐️ **star** the repo! 83 | 84 | Cheers, 85 | 86 | James -------------------------------------------------------------------------------- /curriculum.js: -------------------------------------------------------------------------------- 1 | // 1.0 Intro 2 | // -- What is JavaScript and how does it work? 3 | // -- Install VSCode 4 | // -- Install NodeJS 5 | 6 | // 2.0 Node commands in terminal 7 | // -- Running a file 8 | // -- Killing a file 9 | 10 | // 3.0 Variables 11 | // -- Hello world 12 | // -- Console.log() 13 | console.log("hello world") 14 | 15 | // -- Variables 16 | const mySentence = "hello world" 17 | 18 | let numberOfEggs = 4 // let declaration allows us to reassign a new value, const does not! 19 | 20 | numberOfEggs = 6 21 | 22 | console.log(numberOfEggs + 6, mySentence) 23 | 24 | // -- Code comments 25 | 26 | // this is a comment 27 | // -- Assignment by reference 28 | 29 | let newNumberOfEggs = numberOfEggs 30 | 31 | // 4.0 Data Types (init / read / write) 32 | // -- Strings 33 | 34 | let myString = "hello my name is james" 35 | 36 | let extendedString = myString + '. And I like the color blue.' 37 | 38 | console.log(myString[4]) 39 | 40 | // -- Numbers 41 | const favoriteNumber = 83 42 | 43 | // -- Arrays [] 44 | const groceryList = [ 45 | 'eggs', 46 | 'bananans', 47 | 'bread', 48 | 83, 49 | ] 50 | 51 | groceryList[1] = 'kiwi fruit' 52 | console.log(groceryList[1]) 53 | 54 | // -- Objects {} 55 | const dictionary = { 56 | ocean: 'A body of water between countries', 57 | 58 | 59 | 60 | 61 | sea: 'A different body of water', 62 | myFavoriteNumber: 83 63 | } 64 | 65 | const user = { 66 | name: 'James', 67 | password: '*******' 68 | } 69 | 70 | console.log(user.name, user['password']) 71 | 72 | user.name = 'Elyas' 73 | 74 | user['password'] = '****' 75 | 76 | console.log(user) 77 | 78 | // -- Null 79 | const unknownNumber = null 80 | 81 | // -- Undefined 82 | const undefinedValue = undefined 83 | console.log(unknownNumber, undefinedValue) 84 | 85 | // -- Booleans (true/false) 86 | 87 | const isJamesCool = true 88 | let isCabbageDelicious = false 89 | 90 | // 5.0 Recap 91 | 92 | // 6.0 Logic and Operators 93 | // -- Operators (+ - / %) 94 | const sum = 3 + 9 95 | 96 | const division = 12 / 5 97 | 98 | const remainder = 12 % 5 99 | 100 | const isEven = 12 % 2 101 | 102 | console.log('remainder: ', remainder) 103 | 104 | // -- Logical operators (|| &&) 105 | // see below if else block example 106 | 107 | // -- Type of 108 | 109 | const randomNumber = 833 110 | 111 | console.log(typeof randomNumber, typeof 'random string') 112 | 113 | // 7.0 Conditional Statements 114 | // -- If else 115 | const x = 21 116 | if (x > 10 || x < 20) { 117 | // Whatever code is written in here, is conditionally executed 118 | console.log('The value was greater than 10, or less than 20') 119 | } else { 120 | console.log('The value was not greater than 10, or it was greater than 20') 121 | } 122 | 123 | // 8.0 Loops 124 | // -- While loop 125 | // let i = 0 126 | // while (i < 20) { 127 | // console.log('THE VALUE OF I = ', i) 128 | // i = i + 1 129 | // } 130 | 131 | // -- For loop 132 | const animals = ['duck', 'dog', 'cat', 'piggy'] 133 | console.log(animals) 134 | 135 | for (let j = 0; j < animals.length; j++) { 136 | const currentAnimal = animals[j] 137 | if (currentAnimal == 'dog') { 138 | continue 139 | } 140 | 141 | if (currentAnimal === 'cat') { 142 | break 143 | } 144 | const stringToPrint = 'The animal at index: ' + j + ' And the value at that index is: ' + currentAnimal 145 | console.log(stringToPrint) 146 | } 147 | // for (let j = 0; j < 20; j++) { 148 | // // this is the repeatable code 149 | // console.log(j) 150 | // } 151 | 152 | // -- Continue & break 153 | 154 | // 9.0 Functions 155 | // -- Create a function 156 | function printSquare(y, z) { 157 | // This function prints out the square of a number 158 | console.log(y * z) 159 | } 160 | 161 | printSquare(4, 6) 162 | // -- Invoke a function 163 | // -- Return 164 | 165 | function addStrings(s1 = 'Hello', s2 = 'world') { 166 | const concatString = s1 + s2 167 | console.log(concatString) 168 | if (typeof s1 !== 'string' || typeof s2 !== 'string') { 169 | return 170 | 171 | } 172 | return concatString 173 | } 174 | 175 | const newString = addStrings('James', ' World') 176 | addStrings('Hello ', 'James') 177 | console.log('NEWSTRING: ', newString) 178 | // -- Default inputs 179 | // -- Arrow functions 180 | 181 | const arrowFunction = (arg) => { 182 | console.log('ARG: ', arg) 183 | } 184 | 185 | arrowFunction('Hellow') --------------------------------------------------------------------------------