Giter Club home page Giter Club logo

comparison-number's Introduction

Comparison: Number


Requirements

Compare some numbers then determine which one is bigger or smaller.

Input

  • Two or more different numbers

Process

  • Compare number and number

Output

  • Telling which one is bigger or smaller

Level 0

  • Store different numbers into some variables
  • Create some if else statement blocks that tell if each number is bigger or smaller than our determined value
  • Log that results to the console

Level 1

  • Try to compare those numbers with each other
  • Expand the if else statements into multiple chains
if (condition) {
  // code
} else if (condition) {
  // code
} else {
  // code
}

Level 2

  • Use ternary operator ? : rather than if else statement
condition ? resultA : resultB

Level 3

  • Try to compare a variable with value range, with more than 2 conditions, bigger and smaller than some different value at the same time
  • Experiment with various kind of operations
min >= condition >= max
conditionA && conditionB

Level 4

  • Wrap those logics into some functions that can be called later
  • Use parameters to enable us assign different kind of inputs to compare
  • You need at least two parameters for these functions
function process(parameterA, parameterB) {
  // code
}

process()

Level 5

  • Create a random number generator

comparison-number's People

Contributors

impactbyte-admin avatar mhaidarhanif avatar ayusdipu avatar

Watchers

 avatar

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.