-
Create a function that takes 3 arguments and returns the sum of the these arguments.
-
Create a function named
colorCarthat receives a color, and prints out, 'a red car' for example. -
Create an object and a function that takes the object as a parameter and prints out all of its properties and values.
-
Create a function named
vehicleTypethat receives a color, and a code, 1 for car, 2 for motorbike. And prints 'a blue motorbike' for example when called asvehicleType("blue", 2) -
Can you write the following without the
ifstatement, but with just as a single line withconsole.log(...);?if (3 === 3) { console.log("yes"); } else { console.log("no"); }
-
Create a function called
vehicle, like before, but takes another parameter calledage, so thatvehicle("blue", 1, 5)prints 'a blue used car' -
Make a list of vehicles, you can add
"motorbike","caravan","bike", or more. -
How do you get the third element from that list?
-
Change the function
vehicleto use the list of question 7. So thatvehicle("green", 3, 1)prints "a green new bike".Hint, it should use the
codeto get the value from the list. Sovehicle("green", 2, 1)prints "a green new caravan".