What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-02-24 19:40:09
javascript hashmap
let contacts = new Map() contacts.set('Jessie', {phone: "213-555-1234", address: "123 N 1st Ave"}) contacts.has('Jessie') // true contacts.get('Hilary') // undefined contacts.set('Hilary', {phone: "617-555-4321", address: &qu... Add solution -
Other 2022-02-03 00:15:12
js return unique values from array of objects
const array = [ { id: 3, name: 'Central Microscopy', fiscalYear: 2018 }, { id: 5, name: 'Crystallography Facility', fiscalYear: 2018 }, { id: 3, name: 'Central Microscopy', fiscalYear: 2017 }, { id: 5, name: 'Crystallography Facility', fiscalY... Add solution -
Other 2022-01-31 07:50:53
Given an array of integers, every element appears thrice except for one which occurs once.
let contacts = new Map() contacts.set('Jessie', {phone: "213-555-1234", address: "123 N 1st Ave"}) contacts.has('Jessie') // true contacts.get('Hilary') // undefined contacts.set('Hilary', {phone: "617-555-4321", address: &qu... Add solution -
Javascript 2022-01-23 06:20:56
javascript counting sort
const countingSort = arr => { const min = arr.reduce((acc, v) => (acc < v ? acc : v)) const max = arr.reduce((acc, v) => (acc > v ? acc : v)) const count = new Map() for (let i = min; i <= max; i++) { count[i] = 0 } for ... Add solution -
Javascript 2022-01-22 00:30:31
filter array with unique objects javascript
const array = [ { "name": "Joe", "age": 17 }, { "name": "Bob", "age": 17 }, { "name": "Carl", "age": 35 } ] const key = 'age'; const arrayUniqueByK... Add solution