- In your starter project, open the files in the
w1d3
directory. - Find a partner (preferably one that you have not yet worked with), and work through the following exercises as a pair.
-
Fix the syntax and/or style issues with the following functions:
function isHot(temperature) { if temperature>90 { return "It's hot!"; return "It's not hot!"; } function oldEnoughTo(age) { if age >= 16 return "Drive a car"; } if else (age >= 17); { return "Vote"; else (age => 21) { return "Drink"; } else { return "Do all the things!"; } }
-
Write a function
sayHello
that takes a language parameter, and returns "hello" in that language. Make the function work with at least three languages. -
Write a function
validCredentials
that accepts two parameters: username and password, and returnstrue
if both are long enough, andfalse
otherwise. You can decide what constitutes "long enough".