Coder Social home page Coder Social logo

basic-javascript's Introduction

Javascript Fundamentals Part I

  1. Fork and clone this repository
  2. In the root directory of this folder, run npm install
  3. Add the necessary code in script.js for each function
  4. Run npm test to run the tests
  5. Once the tests pass you are all done!

Problems

  1. Define a function called difference that takes two numbers as arguments and returns their difference.
  2. Define a function called isEqual that takes two arguments and returns a boolean. Return true if the two arguments are equal and return false if they are not.
  3. Define a function called isEven that takes an arbitrary whole number as an argument and return a boolean. Return true if the number is even and false if it is not.
  4. Define a function called isDivisible that takes two arguments and returns a boolean. Return true if the first argument is divisible by the second; otherwise, return false.
  5. Define a function called discountPercentage that returns the total discount ($), given the original amount and discount percentage (as arguments). Return a warning that says "please enter a number between 0 and 100" if the discount amount is greater than 100 or less that 0 percent.
  6. Define a function called isVowel that takes a letter and returns true if the letter is a vowel, and false if the letter is a consonant. (Treat 'y' as a consonant)
  7. Write code that converts a temperature in Celsius to Fahrenheit.
  8. Define a function called biggestOfThree which takes three numbers as arguments, and returns the largest one.
  9. Bonus: Write a function that will estimate your federal income taxes. The function should take just one input: your salary (or future salary, once you graduate!). The link below has information on how federal income taxes are calculated:

Federal Income Tax Brackets

basic-javascript's People

Contributors

craftninja avatar ctide avatar elie avatar lizthedeveloper avatar loganking avatar mjhea0 avatar mmmaaatttttt avatar ryansobol avatar zubaird avatar

Watchers

 avatar

Forkers

prisoka

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.