What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-16 23:45:12
permutaciones con repeticion javascript
function permutator (input) { var set =[]; function permute (arr, data) { var cur, memo = data || []; for (var i = 0; i < arr.length; i++) { cur = arr.splice(i, 1)[0]; if (arr.length === 0) set.push(memo.concat([cur])); ... Add solution -
Javascript 2021-11-15 04:11:25
javascript remove junk element from array
let myArray = ["user1","user2", "", ""] console.log(myArray) function cleanArray(_array) { for (i in _array){ if(_array[i] == ''){ _array.splice(i, 1) } } return _array } console.log(cleanArray... Add solution -
Javascript 2021-10-05 20:34:05
how to DELETE "/api/notes" with an id
app.delete("/api/notes/:id", (req, res) => { let chosenNoteToDelete = req.params.id; fs.readFile(__dirname + "/db/db.json", (err, data) => { if (err) { console.log(err); res.sendStatus(500)... Add solution -
Other 2021-09-12 09:24:02
compare two arrays and remove not matched objects
If you're looping over array1 with i = 0, len = array1.length; i < len; i++, but within the loop you remove an entry from array1 what do you think happens on the next loop? You also appear to be removing things that are found, but your question say yo... Add solution