title


easy.math.double(numb)

easy.math.double() returns the double of the number passed as the argument


syntax:

easy.math.double(numb)

source code:

double(numb) { return numb*2; }

start and end:

arguments:

  1. numb (number):
    the number to be doubled

returns:

numb*2

a number, being the "numb" argument multiplied by 2


example:

easy.document.search("#button").addEventListener('click', () => { const response = window.prompt("please enter a number"); window.alert(`the double of ${response} is ${easy.math.double(response)}`); });

the example above...

  1. adds a click event listener to an element with "button" id (see easy.document.search(query) f)
  2. upon clicked, a prompt is triggered under a const named "response", politely asking the user to enter a number
  3. after the prompt is closed, an alert opens, telling what the double of the response is

combos:

none



see also:

  1. easy.math.half(numb) f
  2. easy.document.search(query) f