First off, congratulations on coming this far, well done!
Use the carGenerator function to generate 10 cars. The file with the function is here: carGenerator.js
You call it like this: generateCars(10);
Create the following arrays:
-
1.1: Cars with speeds between 30 and 60
-
1.2: The makes of the cars that are not lightyellow, so the array is going to look like this: ['BMW', 'Fiat'] etc
-
1.3: Lets change the cars array so it can be read by a danish person. Return an array of objects where the key in the object called speed is called fart (danish for speed), the make is called maerke and the color is called farve. The output will look kind of like this:
[
{
maerke: 'Volvo',
fart: 45,
farve: 'lightYellow',
}
];Let's practice working with Objects and Arrays. Go to FreeCodeCamp and complete all challenges under "Object Oriented and Functional Programming" and the first four challenges under "Basic Algorithm Scripting", up until 'Find the longest word in a string.' https://www.freecodecamp.org/challenges/store-multiple-values-in-one-variable-using-javascript-arrays
- Go to https://api.github.com/orgs/HackYourFuture-CPH/repos, you will see a list of the repositories our HYF organization has (yes it's a lot of JSON).
- You can copy the JSON and put it in a string at the top of your
.jsfile use this tool for that: https://jsonformatter.org/. Copy the json text into the jsonformatter and press this key:
Now you have a json string you can copy into your file. Now print the name of the 3rd github repository to the console.
- Make a
<ul>with a<li>for each repository name (just like you did with the books in the previous assignment). - It should only display the modules that are actually being used in the curriculum at the moment, you of course know which those are, but if you need a reminder you can find them in our curriculum overview.
- Use CSS to divide the page in two columns. The left column will have a list of the names for repository. The right column should have the following information about each repository: the number of
stargazers, the number ofwatchers, the number offorks, thelanguageof the repository. - place the
avatar_url(logo) of our organization somewhere on a nice place in your page.
Go over your homework one last time:
- Does every file run without errors and with the correct results?
- Have you used
constandletand avoidedvar? - Do the variable, function and argument names you created follow the Naming Conventions?
- Is your code well-formatted (see Code Formatting)?
If you can answer yes to the above questions then you are ready to hand if the homework:
- Find the hyf-homework git repo (forked from here)
- Add your homework files in the Javascript/javascript2/week1 folder
- To finish the homework use the link in the top of your classes slack channel.
🎉