What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-19 17:15:22
advanced data manipulation javascript
var array = [“blue”, “green”, “green”, “black”, “orange”, “blue”, “green”, “red”];var uniqueArray = [];uniqueArray = array.filter((element, index, array)=>{... Add solution -
Javascript 2022-03-16 21:05:03
my js
const express = require('express') const app = express() const port = 3000 app.get('/', (req, res) => res.send('Hello World!')) var points = [40, 100, 1, 5, 25, 10]; points.sort((a,b) => a-b) var newArray = array.filter(function(item) { return ... Add solution -
Javascript 2022-01-28 05:55:22
callback without duplicates javascript
function myFunction(myArray, callBack){ var unique = myArray.filter(function(item, pos) { //validates whether the first occurrence of current item in array // equals the current position of the item (only return those items) return myArray.ind... Add solution -
Javascript 2022-01-22 09:30:02
remove object from array of objects based on object property javascript
var myArray = [ {field: 'id', operator: 'eq', value: id}, {field: 'cStatus', operator: 'eq', value: cStatus}, {field: 'money', operator: 'eq', value: money} ]; // only keep objects in array where obj.field !== 'money' myArray = myArray.filt... Add solution