Skip to content

Instantly share code, notes, and snippets.

@rmurphey
Last active October 7, 2015 12:27
Show Gist options
  • Save rmurphey/3164584 to your computer and use it in GitHub Desktop.
Save rmurphey/3164584 to your computer and use it in GitHub Desktop.
Assessment problems for Foundations of Programming with JavaScript

Problem 1

Use JavaScript to write a function that takes a number as its argument. If the number is less than 10, the function should return "small"; if the number is 10 or greater, but less than 100, the function should return "medium"; if the number is 100 or greater, the function should return "large".

Problem 2

Use JavaScript to write a function that takes a number as its argument. If the number is between 1 and 10 (inclusive), return the word for that number (that is, if the number passed to the function is 2, return the word "two"). If the number is not between 1 and 10, return false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment