From 828f02fbba659d65a70ba2ea833a575a72821008 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 11:40:13 +0300 Subject: [PATCH 01/14] Update MAKEME.md --- Week3/MAKEME.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/Week3/MAKEME.md b/Week3/MAKEME.md index 1c593fba0..5ae10e9b1 100644 --- a/Week3/MAKEME.md +++ b/Week3/MAKEME.md @@ -2,7 +2,6 @@ ``` Topics discussed in class this week: -• Git work flow • Advanced data types [Objects] • Conditions • Statements vs Expressions @@ -29,7 +28,6 @@ Provide feedback to the homework of last week to one of your fellow students. Yo - [Naming conventions](./../../../../fundamentals/blob/master/fundamentals/naming_conventions.md) - Go through the topics of this week: - - Git work flow - [Advanced data types (Objects)](./../../../../fundamentals/blob/master/fundamentals/objects.md) - [Conditional execution](./../../../../fundamentals/blob/master/fundamentals/conditional_execution.md) - [Statements vs Expressions](./../../../../fundamentals/blob/master/fundamentals/statements_expressions.md) From 9d2cdd5c28e91200810a12917443f7ae06729414 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 11:41:14 +0300 Subject: [PATCH 02/14] Update README.md --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 53bcaabde..33ad88815 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,16 @@ > Please help us improve and share your feedback! If you find better tutorials or links, please share them by [opening a pull request](https://github.com/HackYourFuture/JavaScript1/pulls). -# HackYourFuture - JavaScript 1 +# Social Hackers Academy - JavaScript 1 Here you can find course content and homework for the JavaScript 1 module |Week|Topic|Read|Homework| |----|-----|----|--------| -|1.|Git Session with Unmesh|[Reading Week 1](/Week1/README.md) | [Homework Week 1](/Week1/MAKEME.md)| +|1.|Git Session |[Reading Week 1](/Week1/README.md) | [Homework Week 1](/Week1/MAKEME.md)| |2.|• Intro JavaScript (What is it, where can you use it for)
• [Variables (var, let, const)](../../../fundamentals/blob/master/fundamentals/variables.md)
• [Basic Data types (Strings, Numbers, Arrays, Booleans)](../../../fundamentals/blob/master/fundamentals/values.md)
• [Operators](../../../fundamentals/blob/master/fundamentals/operators.md)
• [Naming conventions](../../../fundamentals/blob/master/fundamentals/naming_conventions.md)|[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)| |3.|• Git work flow :smiling_imp:
• [Advanced data types (objects)](../../../fundamentals/blob/master/fundamentals/objects.md)
• [Conditional execution](../../../fundamentals/blob/master/fundamentals/conditional_execution.md)
• [Statements vs Expressions](../../../fundamentals/blob/master/fundamentals/statements_expressions.md)
• [Loops (for/while)](../../../fundamentals/blob/master/fundamentals/loops.md)
• [Functions](../../../fundamentals/blob/master/fundamentals/functions.md)
• [Scope](../../../fundamentals/blob/master/fundamentals/scope.md)|[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)| -__Kind note:__ - -We expect you to __always__ come prepared to the class on Sunday. ### Overall A good understanding of all the above mentioned topics. Want to check your Knowledge? Go through the [JavaScript Fundamentals README](../../../fundamentals/blob/master/README.md) and research/ ask for help (Slack!) with the concepts that are not entirely clear. From 997abbe08c9a2baec5398333017ecd2f86e7a386 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 11:41:52 +0300 Subject: [PATCH 03/14] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33ad88815..127f72333 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Here you can find course content and homework for the JavaScript 1 module |----|-----|----|--------| |1.|Git Session |[Reading Week 1](/Week1/README.md) | [Homework Week 1](/Week1/MAKEME.md)| |2.|• Intro JavaScript (What is it, where can you use it for)
• [Variables (var, let, const)](../../../fundamentals/blob/master/fundamentals/variables.md)
• [Basic Data types (Strings, Numbers, Arrays, Booleans)](../../../fundamentals/blob/master/fundamentals/values.md)
• [Operators](../../../fundamentals/blob/master/fundamentals/operators.md)
• [Naming conventions](../../../fundamentals/blob/master/fundamentals/naming_conventions.md)|[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)| -|3.|• Git work flow :smiling_imp:
• [Advanced data types (objects)](../../../fundamentals/blob/master/fundamentals/objects.md)
• [Conditional execution](../../../fundamentals/blob/master/fundamentals/conditional_execution.md)
• [Statements vs Expressions](../../../fundamentals/blob/master/fundamentals/statements_expressions.md)
• [Loops (for/while)](../../../fundamentals/blob/master/fundamentals/loops.md)
• [Functions](../../../fundamentals/blob/master/fundamentals/functions.md)
• [Scope](../../../fundamentals/blob/master/fundamentals/scope.md)|[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)| +|3.|• [Advanced data types (objects)](../../../fundamentals/blob/master/fundamentals/objects.md)
• [Conditional execution](../../../fundamentals/blob/master/fundamentals/conditional_execution.md)
• [Statements vs Expressions](../../../fundamentals/blob/master/fundamentals/statements_expressions.md)
• [Loops (for/while)](../../../fundamentals/blob/master/fundamentals/loops.md)
• [Functions](../../../fundamentals/blob/master/fundamentals/functions.md)
• [Scope](../../../fundamentals/blob/master/fundamentals/scope.md)|[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)| ### Overall From b2e48d8ec5595d58236dacb1865996d913cea0e2 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 20:56:07 +0300 Subject: [PATCH 04/14] Update MAKEME.md --- Week2/MAKEME.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week2/MAKEME.md b/Week2/MAKEME.md index 7eaad7cee..a4d66f81e 100644 --- a/Week2/MAKEME.md +++ b/Week2/MAKEME.md @@ -33,7 +33,7 @@ _Deadline Thursday_ > For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference. -1\. Write a `console.log` statement saying "Hello World!" for each language that you know. +#1\. Write a `console.log` statement saying "Hello World!" for each language that you know. For example: ``` From 4580a83d9a5235e8a44b82bb388f2a958461f738 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 20:56:36 +0300 Subject: [PATCH 05/14] Update MAKEME.md --- Week2/MAKEME.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week2/MAKEME.md b/Week2/MAKEME.md index a4d66f81e..467d27d3a 100644 --- a/Week2/MAKEME.md +++ b/Week2/MAKEME.md @@ -33,7 +33,7 @@ _Deadline Thursday_ > For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference. -#1\. Write a `console.log` statement saying "Hello World!" for each language that you know. +####1\. Write a `console.log` statement saying "Hello World!" for each language that you know. For example: ``` From 60b701acd654e84a112b701c97a6af78d84f1b0b Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 20:56:54 +0300 Subject: [PATCH 06/14] Update MAKEME.md --- Week2/MAKEME.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week2/MAKEME.md b/Week2/MAKEME.md index 467d27d3a..7eaad7cee 100644 --- a/Week2/MAKEME.md +++ b/Week2/MAKEME.md @@ -33,7 +33,7 @@ _Deadline Thursday_ > For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference. -####1\. Write a `console.log` statement saying "Hello World!" for each language that you know. +1\. Write a `console.log` statement saying "Hello World!" for each language that you know. For example: ``` From a78e3145beb8cdc845efb2f28cdd49a101c15a29 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 20:59:48 +0300 Subject: [PATCH 07/14] Update MAKEME.md --- Week2/MAKEME.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Week2/MAKEME.md b/Week2/MAKEME.md index 7eaad7cee..d7501272e 100644 --- a/Week2/MAKEME.md +++ b/Week2/MAKEME.md @@ -27,7 +27,13 @@ _Deadline Wednesday_ Provide feedback on the Git assignments (week 1) of one of your fellow students. You will be assigned to one of the assignments by the class lead of this week. -## Step 3: JavaScript +## Step 3: **Some freeCodeCamp challenges (10 hours):** + +_Deadline Saturday_ + +On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.com/challenges/learn-how-free-code-camp-works) exercises up and until the __"Shopping List"__ exercise (there are some topics we did not cover but you can do it). + +## Step 4: JavaScript _Deadline Thursday_ @@ -145,12 +151,6 @@ if (...) { 10\.2 Can you compare infinities? (Not in Eyad's world) - does 6/0 === 10/0? How can you test this? 10\.3 Add console.log statements to the above program's in which you show that you understand the concepts (just like you've done in the above assignments). -## Step 4: **Some freeCodeCamp challenges (10 hours):** - -_Deadline Saturday_ - -On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.com/challenges/learn-how-free-code-camp-works) exercises up and until the __"Shopping List"__ exercise (there are some topics we did not cover but you can do it). - ## Step 5: Read before next lecture _Deadline Sunday morning_ From 2f487aee233b38d11497a6f8aab1156823286d5f Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 21:00:16 +0300 Subject: [PATCH 08/14] Update MAKEME.md --- Week2/MAKEME.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Week2/MAKEME.md b/Week2/MAKEME.md index d7501272e..c6d5f7293 100644 --- a/Week2/MAKEME.md +++ b/Week2/MAKEME.md @@ -23,20 +23,14 @@ Topics discussed in class this week: ## Step 2: Feedback -_Deadline Wednesday_ - Provide feedback on the Git assignments (week 1) of one of your fellow students. You will be assigned to one of the assignments by the class lead of this week. ## Step 3: **Some freeCodeCamp challenges (10 hours):** -_Deadline Saturday_ - On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.com/challenges/learn-how-free-code-camp-works) exercises up and until the __"Shopping List"__ exercise (there are some topics we did not cover but you can do it). ## Step 4: JavaScript -_Deadline Thursday_ - > For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference. 1\. Write a `console.log` statement saying "Hello World!" for each language that you know. @@ -153,8 +147,6 @@ if (...) { ## Step 5: Read before next lecture -_Deadline Sunday morning_ - Go trough the reading material in the [README.md](/Week3/README.md) to prepare for your next class ### How to hand in Homework: From baae355e5142db446f9af285d8419c4ec8f80fd0 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 21:01:06 +0300 Subject: [PATCH 09/14] Update MAKEME.md --- Week2/MAKEME.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Week2/MAKEME.md b/Week2/MAKEME.md index c6d5f7293..bebf97506 100644 --- a/Week2/MAKEME.md +++ b/Week2/MAKEME.md @@ -32,7 +32,7 @@ On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.co ## Step 4: JavaScript > For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference. - +--- 1\. Write a `console.log` statement saying "Hello World!" for each language that you know. For example: @@ -41,7 +41,7 @@ Halo, dunia! // Indonesian Ciao, mondo! // Italian Hola, mundo! // Spanish ``` - +--- 2\. Consider the following code: ``` @@ -49,7 +49,7 @@ console.log('I'm awesome'); ``` Copy the code in your `.js` file and run it. You will see that you will get a SyntaxError. Find a solution for this error. Hint: read the error message carefully, it also gives an indication of where the problem is. - +--- 3\. Declare a variable `x` and initialize it with an integer, using these exact steps: 3\.1 First, _declare_ your variable `x` (do not initialize it yet). 3\.2 Add a console.log statement that explains that explains in words what _you think_ the value of `x` is, like in this example: @@ -71,7 +71,7 @@ Copy the code in your `.js` file and run it. You will see that you will get a Sy console.log('the value of x will be: whateverYouThinkItWillLog'); // TODO -> log value of x again ``` - +--- 4\. Declare a variable `y` and assign a string to it. 4\.1 Write a console.log statement in which you explain in words what _you think_ the value of the string is. 4\.2 Now console.log the variable `y`. @@ -86,7 +86,7 @@ Copy the code in your `.js` file and run it. You will see that you will get a Sy console.log('the value of my string will be: whateverYouThinkItWillLog'); // TODO -> log the actual value of the string to the console ``` - +--- 5\. How do you round the number 7.25, to the nearest integer (i.e., whole number)? 5\.1 Declare a variable `z` and assign the number 7.25 to it. 5\.2 Console.log `z`. @@ -94,7 +94,7 @@ Copy the code in your `.js` file and run it. You will see that you will get a Sy 5\.4 Console.log `a`. 5\.5 So now we have `z` and `a` find a way to compare the two values and store the highest of the two in a new variable. 5\.6 Console.log the highest value. - +--- 6\. *Arrays!* 6\.1 Declare an empty array. Make sure that the name you choose indicates 'plurality', because an array is capable of containing more than one element. (See [Naming conventions](../fundamentals/naming_conventions.md).) 6\.2 Write a console.log statement that explains in words what you think the value of the array is. @@ -103,13 +103,13 @@ Copy the code in your `.js` file and run it. You will see that you will get a Sy 6\.5 Log your array. 6\.6 Add a statement that adds Daan's favorite animal ('baby pig') to the *existing array*. 6\.7 Log your new array! - +--- 7\. *More strings* 7\.1 Let's consider the following string: `let myString = "this is a test"`. 7\.2 Add the string to your file and console.log it. 7\.3 Find a way to get the length of `myString`. 7\.4 Console.log the length of `myString`. - +--- 8\. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type. 8\.1 First declare at least four variables and assign them different data types. 8\.2 For each variable write a `console.log` statement that logs the value @@ -136,7 +136,7 @@ if (...) { } // TODO -> add a way of giving feedback if your variables don't have the same type ``` - +--- 9\. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the new value of `x`? 9\.1 Add at least 3 `console.log` statements in which you show that you understand what `%` does. From 70c6b3bfe70b6191c3acad63f306ab0dab7a516b Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 21:01:49 +0300 Subject: [PATCH 10/14] Update MAKEME.md --- Week2/MAKEME.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Week2/MAKEME.md b/Week2/MAKEME.md index bebf97506..ae13dcf05 100644 --- a/Week2/MAKEME.md +++ b/Week2/MAKEME.md @@ -32,7 +32,7 @@ On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.co ## Step 4: JavaScript > For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference. ---- +- - - 1\. Write a `console.log` statement saying "Hello World!" for each language that you know. For example: @@ -41,7 +41,7 @@ Halo, dunia! // Indonesian Ciao, mondo! // Italian Hola, mundo! // Spanish ``` ---- +- - - 2\. Consider the following code: ``` @@ -49,7 +49,7 @@ console.log('I'm awesome'); ``` Copy the code in your `.js` file and run it. You will see that you will get a SyntaxError. Find a solution for this error. Hint: read the error message carefully, it also gives an indication of where the problem is. ---- +- - - 3\. Declare a variable `x` and initialize it with an integer, using these exact steps: 3\.1 First, _declare_ your variable `x` (do not initialize it yet). 3\.2 Add a console.log statement that explains that explains in words what _you think_ the value of `x` is, like in this example: @@ -71,7 +71,7 @@ Copy the code in your `.js` file and run it. You will see that you will get a Sy console.log('the value of x will be: whateverYouThinkItWillLog'); // TODO -> log value of x again ``` ---- +- - - 4\. Declare a variable `y` and assign a string to it. 4\.1 Write a console.log statement in which you explain in words what _you think_ the value of the string is. 4\.2 Now console.log the variable `y`. @@ -86,7 +86,7 @@ Copy the code in your `.js` file and run it. You will see that you will get a Sy console.log('the value of my string will be: whateverYouThinkItWillLog'); // TODO -> log the actual value of the string to the console ``` ---- +- - - 5\. How do you round the number 7.25, to the nearest integer (i.e., whole number)? 5\.1 Declare a variable `z` and assign the number 7.25 to it. 5\.2 Console.log `z`. @@ -94,7 +94,7 @@ Copy the code in your `.js` file and run it. You will see that you will get a Sy 5\.4 Console.log `a`. 5\.5 So now we have `z` and `a` find a way to compare the two values and store the highest of the two in a new variable. 5\.6 Console.log the highest value. ---- +- - - 6\. *Arrays!* 6\.1 Declare an empty array. Make sure that the name you choose indicates 'plurality', because an array is capable of containing more than one element. (See [Naming conventions](../fundamentals/naming_conventions.md).) 6\.2 Write a console.log statement that explains in words what you think the value of the array is. @@ -103,13 +103,13 @@ Copy the code in your `.js` file and run it. You will see that you will get a Sy 6\.5 Log your array. 6\.6 Add a statement that adds Daan's favorite animal ('baby pig') to the *existing array*. 6\.7 Log your new array! ---- +- - - 7\. *More strings* 7\.1 Let's consider the following string: `let myString = "this is a test"`. 7\.2 Add the string to your file and console.log it. 7\.3 Find a way to get the length of `myString`. 7\.4 Console.log the length of `myString`. ---- +- - - 8\. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type. 8\.1 First declare at least four variables and assign them different data types. 8\.2 For each variable write a `console.log` statement that logs the value @@ -136,7 +136,7 @@ if (...) { } // TODO -> add a way of giving feedback if your variables don't have the same type ``` ---- +- - - 9\. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the new value of `x`? 9\.1 Add at least 3 `console.log` statements in which you show that you understand what `%` does. From f3fe10a744d91047de968964b8999d0853044ec0 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 21:04:50 +0300 Subject: [PATCH 11/14] Update MAKEME.md --- Week3/MAKEME.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Week3/MAKEME.md b/Week3/MAKEME.md index 5ae10e9b1..0188d1906 100644 --- a/Week3/MAKEME.md +++ b/Week3/MAKEME.md @@ -70,8 +70,11 @@ let myString = "hello,this,is,a,difficult,to,read,sentence"; ``` 1\.1 Add the string to your file and log it. + 1\.2 Log the length of `myString`. + 1\.3 The commas make that the sentence is quite hard to read. Find a way to remove the commas from the string and replace them with spaces. + 1\.4 Log `myString` to see if you succeeded. 2\. **Arrays!** @@ -83,14 +86,23 @@ let favoriteAnimals = ['blowfish', 'capricorn', 'giraffe']; ``` 2\.1 Add a statement that adds Mauro's favorite animal *'turtle'* to the existing array. + 2\.2 Log your new array! + 2\.3 Now add Jim's favorite animal to the array, it's *'meerkat'*, but make sure it will be placed after *'blowfish'* and before *'capricorn'*. + 2\.4 Write a console.log statement that explains in words _you think_ the new value of the array is. + 2\.5 Log your new array! + 2\.6 Log the length of the array, add a message: *'The array has a length of: '* (here you should show the length of the array). + 2\.7 Jason does not like *'giraffe'*, delete this animal from the array. + 2\.8 Again log your new array. + 2\.9 Now if unlike Jim, you don't like *'meerkat'* and you want to delete it from the array, but you don't know the position or the `index` of the item in the array, how can you find it? + 2\.10 Log the index of *'meerkat'*. Add a message so it says: *'The item you are looking for is at index: '* (here you should show the index of the item). ## More JavaScript :tada: From e6682cf357b844655080e1355e09cc1c2009cb10 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Wed, 18 Apr 2018 21:07:27 +0300 Subject: [PATCH 12/14] Update README.md --- Week3/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/Week3/README.md b/Week3/README.md index 71df5c72c..96345eafe 100644 --- a/Week3/README.md +++ b/Week3/README.md @@ -2,7 +2,6 @@ ``` In week three we will discuss the following topics: -• Git work flow • Advanced data types [Objects] • Conditions • Statements vs Expressions From 2c566c5f8df57593b8fec908744764c96ac665b3 Mon Sep 17 00:00:00 2001 From: Chris Owen Date: Thu, 19 Apr 2018 21:32:58 +0300 Subject: [PATCH 13/14] Update README.md --- Week1/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week1/README.md b/Week1/README.md index a4bea4c62..c6131a0ee 100644 --- a/Week1/README.md +++ b/Week1/README.md @@ -7,7 +7,7 @@ In week one we will discuss the following topics: ### Here are resources that we like you to read as a preparation for the coming lecture. -- In you next lecture **Unmesh** will give you your first Git session, please look through the [GIT](https://github.com/HackYourFuture/Git) repository and read the learning goals. +- In you next lecture we will give you your first Git session, please look through the [GIT](https://github.com/SocialHackersCodeSchool/Git) repository and read the learning goals. - Please watch [Up Running with Bash Scripting](https://www.lynda.com/Bash-tutorials/Up-Running-Bash-Scripting/142989-2.html) as a recap on the cli classes you have had (1 hour and 25 min). Please ask Gijs or Maartje for access to Lynda.com - Please watch the first 5 chapters of the [Git essential training](https://www.lynda.com/Git-tutorials/Git-Essential-Training/100222-2.html) From 7406d8b4ece24edba88f0ed366291202d1c7b28a Mon Sep 17 00:00:00 2001 From: winslet <50847773+winlov1@users.noreply.github.com> Date: Fri, 30 Aug 2019 10:15:16 -0700 Subject: [PATCH 14/14] Add my js file --- index.js | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 000000000..f31cc53b4 --- /dev/null +++ b/index.js @@ -0,0 +1,98 @@ + +//my homework + +let salute = {english:'Hello', Amaric:'Salam', arabic: 'Marhabaan', turkish:'Marhaba', greek:'Yia-sas'}; +console.log(salute); + + + + +console.log("I'm awesome"); + + + + +let x; +console.log('variable x will be: undifined'); +console.log(x); +x = 200; +console.log('variable x will be: 200'); +console.log(x); + + + +let y = "winny"; +console.log('the string will be: winny'); +console.log(y); + + + +let z = 7.25; +console.log(z); + +let a = z.toFixed(0); +console.log(a) +let h = az){ +console.log(a) +} +else { +console.log(z) +} + + + +let makeup = []; +console.log('squre brackets') +console.log(makeup) +let animals = ['monkey', 'giraffe', 'lion', 'peacock'] +console.log(animals) +animals.push('big pig') +console.log(animals) + + + +var string = "this is a test"; +console.log(string) +console.log(string.length); + + +let num1 = 45; +let fruit = "love"; +const num2 = null; +let ask = false; +console.log(num1); +console.log(fruit); +console.log(num2); +console.log(ask); +console.log("types = Number String Null Boolean"); +console.log(typeof num1); +console.log(typeof fruit); +console.log(typeof num2); +console.log(typeof ask); +if (num1 === fruit) { + console.log('Same Type') +} +else{ + console.log('not same type') +} + + +var d = 7 % 3; +console.log(d); +console.log('% is reminder') +console.log('% = 1') + + + +let mixed = ["solomon", "winslet", 45, "Ethiopia", 444 ]; +console.log(mixed); + +const number1 = 6/0; +const number2 = 10/0; +if (number1 === number2){ + console.log("same number") +} +else{ + console.log("Not the same number") +} \ No newline at end of file