Skip to content

Latest commit

 

History

History
40 lines (32 loc) · 1.04 KB

warmup13.md

File metadata and controls

40 lines (32 loc) · 1.04 KB

Warmup

Instructions

  1. In your starter project, open the files in the w1d3 directory.
  2. Find a partner (preferably one that you have not yet worked with), and work through the following exercises as a pair.

Exercises

  1. 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!";
      }
    }
  2. Write a function sayHello that takes a language parameter, and returns "hello" in that language. Make the function work with at least three languages.

  3. Write a function validCredentials that accepts two parameters: username and password, and returns true if both are long enough, and false otherwise. You can decide what constitutes "long enough".