What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-21 14:40:31
code to convert rgb to hsl color
// see: https://en.wikipedia.org/wiki/RGB_color_model // see: https://en.wikipedia.org/wiki/HSL_and_HSV // expects R, G, B, Cmax and chroma to be in number interval [0, 1] // returns undefined if chroma is 0, or a number interval [0, 360] degrees functio... Add solution -
Javascript 2021-11-12 17:14:20
Return Distinct Array Object
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 -
Javascript 2021-11-12 10:20:18
openlayers satellite imagery
import 'ol/ol.css'; import BingMaps from 'ol/source/BingMaps'; import Map from 'ol/Map'; import TileLayer from 'ol/layer/Tile'; import View from 'ol/View'; var styles = [ 'RoadOnDemand', 'Aerial', 'AerialWithLabelsOnDemand', 'CanvasDark', 'Ordn... Add solution -
TypeScript 2021-11-10 12:09:19
filter duplicate value in array of object typescript
let person = [{name: "john"}, {name: "jane"}, {name: "imelda"}, {name: "john"}]; function removeDuplicates(data, key) { return [ ...new Map(data.map(item => [key(item), item])).values() ] }; console... Add solution -
Javascript 2021-10-21 22:12:05
how to collect multiple fields using busboy nodejs
app.post('/somewhere', (req, res) => { let formData = new Map(); req.busboy.on('field', function(fieldname, val) { formData.set(fieldname, val); }); req.busboy.on("finish", function() { console.log(formData) // Map { 'name'... Add solution -
Javascript 2021-10-19 13:30:10
node get value from map
let myMap = new Map(); myMap.set("key1", "value1"); myMap.set("key2", "value2"); console.log(myMap.has("key1")); // true console.log(myMap.has("key2")); // true console.log(myMap.get("key... Add solution -
Javascript 2021-10-14 07:44:07
get unique values from array of objects javascript
const array = [ { "name": "Joe", "age": 17 }, { "name": "Bob", "age": 17 }, { "name": "Carl", "age": 35 } ] const key = 'age'; const arrayUniqueByK... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5