What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-22 04:18:06
who to accses to an object vallue inside an array with .filter method js
const array = [ { username: "john", team: "red", score: 5, items: ["ball", "book", "pen"] }, { username: "becky", team: "blue", score: 10, items: [... Add solution -
Javascript 2021-10-22 00:37:06
js array from text file
const fs = require('fs') const makeArrayFromTextFile = (path) => { const text = fs.readFileSync(path, 'utf-8') const textByLine = text.split('\n') return textByLine } const array = makeArrayFromTextFile('./array.txt') console.log(array) // ['... 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 -
Javascript 2021-10-05 19:07:06
compare object array equals
// Compare Objects const objectsEqual = (o1, o2) => Object.keys(o1).length === Object.keys(o2).length && Object.keys(o1).every(p => o1[p] === o2[p]); const obj1 = { name: 'John', age: 33}; const obj2 = { age: 33, name: 'John' }... Add solution -
Javascript 2021-10-04 00:07:06
if array ontains any item of another array js
const array1= ["cheese", "dough", "sauce", "pepperoni"] const array2= ["mozzarella", "peppers", "chicken", "cheese"] const isIncluded = array1.some(value => array2.includ... Add solution
Best helpers
Ranking is empty