diff --git a/README.md b/README.md index dbf980860..b103d2a06 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -> If you are following the HackYourFuture curriculum we recommend you to start with module 1: [HTML/CSS/GIT](https://github.com/HackYourFuture/HTML-CSS). To get a complete overview of the HackYourFuture curriculum first, click [here](https://github.com/HackYourFuture/curriculum). +> If you are following the curriculum we recommend you to start with module 1: [HTML/CSS/GIT](https://github.com/SocialHackersCodeSchool/HTML-CSS). To get a complete overview, click [here](https://github.com/SocialHackersCodeSchool/curriculum). > 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). +> or links, please share them by [opening a pull request](https://github.com/SocialHackersCodeSchool/JavaScript1/pulls). # Module #2 - JavaScript 1: Programming Basics (Frontend) @@ -71,8 +71,11 @@ If you have any questions or if something is not entirely clear ¯\\\_(ツ)\_/¯ Did you finish the module? Good job! You're doing great! -If you feel ready for the next challenge, click [here](https://www.github.com/HackYourFuture/JavaScript2) to go to JavaScript2! +If you feel ready for the next challenge, click [here](https://www.github.com/SocialHackersCodeSchool/JavaScript2) to go to JavaScript2! + +## Credit: +This curriculum is developed by [HackYourFuture](https://github.com/HackYourFuture), modifications, and +changes can be found in this Fork. -_The HackYourFuture curriculum is subject to CC BY copyright. This means you can freely use our materials, but just make sure to give us credit for it :)_ Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. diff --git a/Week1/README.md b/Week1/README.md index ecfaf004b..ea3ed54a9 100644 --- a/Week1/README.md +++ b/Week1/README.md @@ -56,7 +56,7 @@ There are various languages, each made to fulfill a certain need. For example, M ## 1. What is web development? -In HackYourFuture we focus on `web` programmming (also known as `web development`): writing code that creates websites and web applications. Look at the following video to learn about what you'll be doing: +In this course we focus on `web` programmming (also known as `web development`): writing code that creates websites and web applications. Look at the following video to learn about what you'll be doing: - [What does a web developer do?](https://www.youtube.com/watch?v=GEfuOMzRgXo) diff --git a/Week1/homework/js-exercices/animalTable.js b/Week1/homework/js-exercices/animalTable.js new file mode 100644 index 000000000..3ffa63f2e --- /dev/null +++ b/Week1/homework/js-exercices/animalTable.js @@ -0,0 +1,21 @@ +'use strict' +let numbersTable=[]; +console.log("I create an empty table"); +numbersTable=[1, 3, 5, 7, 9]; +console.log("Numbers table:"); +let x; let i=0; +for (x of numbersTable) { + console.log(numbersTable[i]); i++; +} +let animalsTable=["Lion", "Cat", "Dogg"]; +console.log("\nAnimals table 1:"); +i=0; +for (x of animalsTable) { + console.log(animalsTable[i]); i++; +} +animalsTable.push("Porcelet"); +console.log("\nAnimals table 2:"); +i=0; +for (x of animalsTable) { + console.log(animalsTable[i]); i++; +} diff --git a/Week1/homework/js-exercices/aroundNumber.js b/Week1/homework/js-exercices/aroundNumber.js new file mode 100644 index 000000000..d0b73ac08 --- /dev/null +++ b/Week1/homework/js-exercices/aroundNumber.js @@ -0,0 +1,7 @@ +'use strict' +let z=7.25; +console.log("Declaration and initialisation the variable z: "+z); +let a=parseInt(z); +console.log("Declaration and initialisation the variable a: "+a); +let max=(z>a ? z : a); +console.log("The greatest value: "+max); diff --git a/Week1/homework/js-exercices/compareArray.js b/Week1/homework/js-exercices/compareArray.js new file mode 100644 index 000000000..12a62349b --- /dev/null +++ b/Week1/homework/js-exercices/compareArray.js @@ -0,0 +1,6 @@ +'use strict' +const array1 = [ "hello" , 123 , true , { name : "Noer" } ] , array2=["balde", "diallo", "sow", "barry"]; +console . log ( "the length of the table 1 is: " +array1.length +", the length of the table 2 is: "+array1.length) ; +if(array1.length==array2.length){ + console.log("They are the same!"); +}else{ console.log("Two different sizes");} \ No newline at end of file diff --git a/Week1/homework/js-exercices/debugError.js b/Week1/homework/js-exercices/debugError.js new file mode 100644 index 000000000..4a76173c3 --- /dev/null +++ b/Week1/homework/js-exercices/debugError.js @@ -0,0 +1,2 @@ +'use strict' +console.log("I'm awesome"); \ No newline at end of file diff --git a/Week1/homework/js-exercices/lenghOfString.js b/Week1/homework/js-exercices/lenghOfString.js new file mode 100644 index 000000000..24e4e1c85 --- /dev/null +++ b/Week1/homework/js-exercices/lenghOfString.js @@ -0,0 +1,3 @@ +'use strict' +let mySentence="La programmation est tellement intéressante!"; +console.log("the lengh of my sentence is: "+mySentence.length); diff --git a/Week1/homework/js-exercices/logHello.js b/Week1/homework/js-exercices/logHello.js new file mode 100644 index 000000000..70eda7ad4 --- /dev/null +++ b/Week1/homework/js-exercices/logHello.js @@ -0,0 +1,11 @@ +'use strict' +console.log("Hello, world"); //English +console.log("Bonjour, tout le monde"); //French +console.log("Halo, dunia!"); // Indonesian +console.log("Ciao, mondo!"); // Italian +console.log("Hola, mundo!"); // Spanish +console.log("Hallo Welt"); //Deuch +console.log("Hej Verden"); //Danois +console.log("Γειά σου Κόσμε"); //Greek +console.log("Helo Byd"); //Gallois +console.log("Dia duit, domhan"); //Irlandais \ No newline at end of file diff --git a/Week1/homework/js-exercices/logRemainder.js b/Week1/homework/js-exercices/logRemainder.js new file mode 100644 index 000000000..baba47af5 --- /dev/null +++ b/Week1/homework/js-exercices/logRemainder.js @@ -0,0 +1,8 @@ +'use strict' +let x=7, y= 21, z=13; +x = x % 3; y = y % 4; z = z % 2; +console.log("the remainde of x/3 is: "+x); +console.log("the remainde of y/4 is: "+y); +console.log("the remainde of z/2 is: "+z); + + diff --git a/Week1/homework/js-exercices/saveNumber.js b/Week1/homework/js-exercices/saveNumber.js new file mode 100644 index 000000000..83bbf1922 --- /dev/null +++ b/Week1/homework/js-exercices/saveNumber.js @@ -0,0 +1,7 @@ +'use strict' +let myNum; +console.log("Variable declaration"); +console.log("variable initialisation"); +myNum=19; +console.log("the variable type is :"+typeof(myNum)); +console.log("the variable value is :"+myNum); diff --git a/Week1/homework/js-exercices/saveString.js b/Week1/homework/js-exercices/saveString.js new file mode 100644 index 000000000..72578eed5 --- /dev/null +++ b/Week1/homework/js-exercices/saveString.js @@ -0,0 +1,7 @@ +'use strict' +let myString="Boubacar Balde"; +console.log("The variable is a string and containt my name"); +console.log("the variable value is :"+myString); +myString="My new string sentence"; +console.log("The variable containt a new string"); +console.log("the variable value is :"+myString); diff --git a/Week1/homework/js-exercices/verifyType.js b/Week1/homework/js-exercices/verifyType.js new file mode 100644 index 000000000..4b5c2909d --- /dev/null +++ b/Week1/homework/js-exercices/verifyType.js @@ -0,0 +1,26 @@ +'use strict' +let vari1="First variable", vari2="Second variable", vari3=null, vari4=null; +console.log("the variable 1 type is: "+typeof(vari1)+" the variable 2 type is : "+typeof(vari2)); +if(typeof(vari1)===typeof(vari2)){ + console.log('SAME TYPE'); +}else{console.log('NOT SAME TYPE');} +console.log("the variable 1 type is: "+typeof(vari1)+" the variable 3 type is : "+typeof(vari3)); +if(typeof(vari1)===typeof(vari3)){ + console.log('SAME TYPE'); +}else{console.log('NOT SAME TYPE');} +console.log("the variable 1 type is: "+typeof(vari1)+" the variable 4 type is : "+typeof(vari4)); +if(typeof(vari1)===typeof(vari4)){ + console.log('SAME TYPE'); +}else{console.log('NOT SAME TYPE');} +console.log("the variable 2 type is: "+typeof(vari2)+" the variable 3 type is : "+typeof(vari3)); +if(typeof(vari2)===typeof(vari3)){ + console.log('SAME TYPE'); +}else{console.log('NOT SAME TYPE');} +console.log("the variable 2 type is: "+typeof(vari2)+" the variable 4 type is : "+typeof(vari4)); +if(typeof(vari2)===typeof(vari4)){ + console.log('SAME TYPE'); +}else{console.log('NOT SAME TYPE');} +console.log("the variable 3 type is: "+typeof(vari3)+" the variable 4 type is : "+typeof(vari4)); +if(typeof(vari3)===typeof(vari4)){ + console.log('SAME TYPE'); +}else{console.log('NOT SAME TYPE');} diff --git a/Week2/homework/js-execices/readingList.js b/Week2/homework/js-execices/readingList.js new file mode 100644 index 000000000..b72dd6e92 --- /dev/null +++ b/Week2/homework/js-execices/readingList.js @@ -0,0 +1,25 @@ +'use strict' +var mesLivres=[ + { + title:"Les Crapauds-brousse", + author:"Tierno Monénembo", + alreadyRead:true, + }, + { + title: "La Révolte des bovidés", + author: "Amadou Hampâté Bâ", + alreadyRead: true, + }, + { + title: "Hosties noires", + author: "Léopold Sédar Senghor", + alreadyRead: false, + } + +] +for (let livreX of mesLivres ) { + console.log(livreX.title+" of "+livreX.author) + if(livreX.alreadyRead){ + console.log("You already read : "+livreX.title+"\n") + }else{ console.log("You still need to read : "+livreX.title+"\n")} +} diff --git a/Week2/homework/js-execices/recipeCard.js b/Week2/homework/js-execices/recipeCard.js new file mode 100644 index 000000000..8f9bd1616 --- /dev/null +++ b/Week2/homework/js-execices/recipeCard.js @@ -0,0 +1,12 @@ +'use strict' +var maRecette={ + name: "Omelete", + serves: 2, + ingredients: ["4 eggs", "2 strips of bacon", "tsp salt/pepper" ] +} +console.log("My meal name is: " +maRecette.name+" \nServes : "+maRecette.serves); +let ingr="Ingredients :\n" +for(var x of maRecette.ingredients ){ + ingr+=x+"\n"; +} +console.log(ingr); \ No newline at end of file diff --git a/Week2/homework/js-execices/removeComma.js b/Week2/homework/js-execices/removeComma.js new file mode 100644 index 000000000..43fa5d765 --- /dev/null +++ b/Week2/homework/js-execices/removeComma.js @@ -0,0 +1,6 @@ +'use strict' +let myString = "hello,this,is,a,difficult,to,read,sentence"; +console.log("my string in the first time: "+myString); +console.log("the length of my String is: "+myString.length); +myString = myString.replace(/,/g, " "); +console.log("my string in the second time: "+myString); diff --git a/Week2/homework/js-execices/reportEvenOdd.js b/Week2/homework/js-execices/reportEvenOdd.js new file mode 100644 index 000000000..3620088e1 --- /dev/null +++ b/Week2/homework/js-execices/reportEvenOdd.js @@ -0,0 +1,6 @@ +'use strict' +for(let x=1; x<=20; x++){ + if((x % 2) ==0){ + console.log("The number: "+x+" is odd!"); + }else{console.log("The number: "+x+" is even!");} +} diff --git a/Week2/homework/js-execices/wantsDrink.js b/Week2/homework/js-execices/wantsDrink.js new file mode 100644 index 000000000..30f7ce0aa --- /dev/null +++ b/Week2/homework/js-execices/wantsDrink.js @@ -0,0 +1,17 @@ +'use strict' +let drinkTray = []; +const drinkTypes = [ "cola" , "limonade" , "eau" ]; +let y=1 ; +drinkTypes.forEach(function(element){ + let x=1; + do{ + drinkTray.push(element); x++; y++; + }while((x<=2) && (y<5)); +}); +let drinkGay="Hey guys, I brought a "; y=1; +drinkTray.forEach(function(element){ + if (y2){ + epicerieTab.shift(); + } + epicerieTab.push(article); + console.log("You bought "+epicerieTab); + +} +let epicerieTab=["Bananas", "Milk"]; +addToShoppingCart("Mangue"); +addToShoppingCart("Orange"); +addToShoppingCart("Fraise"); \ No newline at end of file diff --git a/Week3/homework/js-execices/totalCost.js b/Week3/homework/js-execices/totalCost.js new file mode 100644 index 000000000..d9507fe44 --- /dev/null +++ b/Week3/homework/js-execices/totalCost.js @@ -0,0 +1,17 @@ +'use strict' +function calculateTotalPrice(price) { + let cal=0; + for(let obj in price){ + cal+=price[obj]; + } + console.log("the total price of all items is : "+cal+"euros") +} + +let cartForParty={ + oil: 6.88, + paper: 0.75, + vegetable:5.22, + Milk : 0.65, + Mayonnaise: 1.43 +} +calculateTotalPrice(cartForParty); \ No newline at end of file