Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

randomNumberGeneratorInRange in js

function randomNumberGeneratorInRange(rangeStart, rangeEnd) {
	return Math.floor(Math.random()*(rangeEnd-rangeStart +1)) +rangeStart
  // Or 
  //return Math.floor(Math.random()*(rangeEnd - rangeStart))+rangeStart
}

console.log(`My random number: ${randomNumberGeneratorInRange(5, 100)}`)
 
PREVIOUS NEXT
Tagged: #randomNumberGeneratorInRange #js
ADD COMMENT
Topic
Name
4+2 =