largest and smallest number in an array 1-100 javascript
const array1 = [1, 3, 2];
Math.max(...array1);
// expected output: 3let numArray = [95, 1, 75, 7, 12, 50, 3, 88]
numArray.slice().sort(function(a, b) {
return a - b
})
console.log('smallest: ' + numArray[0] + ', largest: ' + numArray[numArray.length - 1])
Also in JavaScript:
- get date in javascript
- express request path
- javascript reduce method stack overflow
- curl pass raw json in post request
- angular on back skip routes
- reduce average javascript
- how to add dropdown with filter in angular material
- js string contains
- does a function inside a function need to be called?
- dwhdjksbhds efedhgsd djsioqdhsjd
- javascript object tostring
- js array length
- JS glob to regex
- vue timeout
- express check if object is empty
- react pass parameter to component
- regex only uppercase letters js
- print code in js stackoverflow
- Property 'fromPromise' does not exist on type 'typeof Observable'. rxjs 6
- how to get user ip address in javascript
- react hooks update nested object
- Sum of all the multiples of 3 or 5
- mongodb unwind
- how to disable menu bar in browser using javascript