This covers up, the javascript version : es6
What's your favorite song?
Think of all the attributes that you could use to describe that song. That is: all of it's details or "meta-data". These are attributes like "Artist", "Year Released", "Genre", "Duration", etc. Think of as many different characteristics as you can. Now, within that file, list all of the attributes of the song, one after another, by creating variables for each attribute, and giving each variable a value.
File name : song.js
What are the differences between let, const and var?
When would each be appropriate too use?
In your own words, write 1 - 2 paragraphs explaining the different use-cases for each. If English is not your native language, feel free to write in whatever language you prefer. Just please note which language it is at the top of the assignment, so we know how to translate it.
Then, within the document write 3 code examples (1 for var, 1 for const and 1 for let) showcasing the use-cases.
File name : variable.js
Let's look at a popular logical argument (a syllogism)
Syllogism 1 :
All men are mortal
Socrates is a man.
Therefore, socrates is mortal.
Using "if statements" and any other logical operators and data-types you see fit, recreate this logical argument. Your code should make clear that "socrates" is part of a collection of items referred to as "men", and that all members of this collection are mortal. You should also then demonstrate that since Socrates is part of this collection, it follows that he is mortal as well.
Syllogism 2 :
This cake is either vanilla or chocolate.
This cake is not chocolate.
Therefore, this cake is vanilla.
File name : syllogism.js
Let's go back to your syllogism (logical argument) examples from Homework #3. Now it's time to turn those loose bits of logic into functions. Rather than having procedure that demonstrates that Socrates is mortal, you should create a function that accepts a name and returns a boolean (True or False) representing whether that name identifies a man who is mortal or not. Your function to gracefully handle unexpected inputs (such as an unrecognized name or a name that is a not a string at all) without throwing an exception.
File name : function.js
Create a function called "timeAdder" that can add two time values together. For example, it should be able to add 25 hours and 3 days together.
The function should accept 4 parameters:
value1, label1, value2, label2
-
value1 and value2 should accept positive integers
-
label1 and label2 should accept any of the following strings: "seconds", "minutes", "hours", "days", "second", "minute", "hour", "day"
File name : switchStatments.js
Write a program that prints the numbers from 1 to 100.
- But fro multiples of three prints "Fizz", instead of the number,
- And for the multiple of five prints "Buzz",
- For number which are multiples of both three and five, print "FizzBuzz" in place of number.
- Prints prime in place of number, if prime number is encountered.
File name : FizzBuzz.js