What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-16 16:30:04
get all from dir node
//requiring path and fs modules const path = require('path'); const fs = require('fs'); //joining path of directory const directoryPath = path.join(__dirname, 'Documents'); //passsing directoryPath and callback function fs.readdir(directoryPath, functio... Add solution -
Other 2022-03-13 06:15:16
1. Given a phrase, count the occurrences of each word in that phrase.
function count(str) { var obj = {}; str.split(" ").forEach(function(el, i, arr) { obj[el] = obj[el] ? ++obj[el] : 1; }); return obj; } console.log(count("olly olly in come free")); Add solution -
Javascript 2022-03-11 05:30:33
javascript for group object properties based on another property
var list = [ { date: "2017-01-01", type: "type1", amount: 100 }, { date: "2017-01-01", type: "type2", amount: 150 }, { date: "2017-01-02",... Add solution -
Javascript 2022-02-28 14:40:05
node list files in directory
//requiring path and fs modules const path = require('path'); const fs = require('fs'); //joining path of directory const directoryPath = path.join(__dirname, 'Documents'); //passsing directoryPath and callback function fs.readdir(directoryPath, functio... Add solution -
Other 2022-02-10 00:15:17
Number format only in input
// Restricts input for the given textbox to the given inputFilter function. function setInputFilter(textbox, inputFilter) { ["input", "keydown", "keyup", "mousedown", "mouseup", "select", "... Add solution -
Javascript 2022-02-02 08:55:31
express get all endpoints
const routes = {} function routerRecursion(middleware, pointer, currentName) { if (middleware.route) { // routes registered directly on the app if (!Array.isArray(pointer['routes'])) { pointer['routes'] = [] } const routeObj = { ... Add solution -
Javascript 2022-02-01 05:21:38
javascript loop over three-dimensional array
var items = [[['firstName', 'Joe'], ['lastName', 'Blow'], ['age', 42], ['role', 'clerk']], [['firstName', 'Mary'], ['lastName', 'Jenkins'], ['age', 36], ['role', 'manager']]]; var result = []; // first loop through items items.forEach(function(item) { ... Add solution -
Javascript 2022-02-01 00:35:20
pdf javascript search text
var searchText = "JavaScript"; function searchPage(doc, pageNumber) { return doc.getPage(pageNumber).then(function (page) { return page.getTextContent(); }).then(function (content) { // Search combined text content using regular expr... 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