What do you want to save?
Add Code snippet
New code examples
-
Other 2021-08-28 09:48:02
Remove element from array JavaScript
var colors = ["red","blue","car","green"]; var carIndex = colors.indexOf("car");//get "car" index //remove car from the colors array colors.splice(carIndex, 1); // colors = ["red",&... Add solution -
Javascript 2021-08-28 04:29:02
javascript compare duplicates in array
let strArray = [ "q", "w", "w", "w", "e", "i", "u", "r"]; let findDuplicates = arr => arr.filter((item, index) => arr.indexOf(item) != index) console.log(findDuplicates... Add solution -
Javascript 2021-08-28 00:00:02
second largest number in array javascript
var secondMax = function (){ var arr = [20, 120, 111, 215, 54, 78]; // use int arrays var max = Math.max.apply(null, arr); // get the max of the array arr.splice(arr.indexOf(max), 1); // remove max from the array return Math.max.apply(nul... Add solution -
Javascript 2021-08-27 20:14:01
get browser id using javascript
agent = {browser:{name:null,version:null,v:null,userAgent:null,app:null,os:null},mobile:false,pointlock:false}; var nVer = navigator.appVersion; var nAgt = navigator.userAgent; var browserName = navigator.appName; var fullVersion = ''+parseFloat(naviga... Add solution