What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2022-02-26 18:05:21
filter duplicate value in typescript
var arrOfObj = [ { id:1 ,name:'abc',age:27 }, { id:2 ,name:'pqr',age:27 }, { id:1 ,name:'abc',age:27 }, ] var setObj = new Set(); // create key value pair from array of array var result = arrOfObj.reduce((acc,item)=>{ if(!s... Add solution -
Javascript 2022-02-14 00:45:18
“new Set” is returning an empty set in nodejs
Instead of: const set = new Set(['foo', 'bar', 'baz', 'foo']); // Set(3) { 'foo', 'bar', 'baz' } const result = [...set] // [] Do: const set = new Set(['foo', 'bar', 'baz', 'foo']); // Set(3) { 'foo', 'bar', 'baz' } const result = Array.from(set) // ['fo... Add solution -
Javascript 2022-02-02 21:30:20
js check string for isogram
// Check if a string is an isogram function isIsogram(str){ return !str.match(/([a-z]).*\1/i); //or: return new Set(str.toLowerCase()).size === str.length; } console.log(isIsogram("Dermatoglyphics"));//, true console.log(isIsogram("iso... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5