What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-16 22:30:12
javascript loop through arrya
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Java 2022-03-16 18:55:26
auto_increment homecontroller
<%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib uri="htt... Add solution -
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-16 09:30:04
bootstrap hide navbar
const navLinks = document.querySelectorAll('.nav-item') const menuToggle = document.getElementById('navbarSupportedContent') const bsCollapse = new bootstrap.Collapse(menuToggle) navLinks.forEach((l) => { l.addEventListener('click', () => { bsCo... 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
Best helpers
Rlw
+5
John Rualo
+5
Michael Wang
+5
Heavens
+5
Calvino
+5
Withparadox2
+5
SuzyTypehead
+5
Aj Morales
+5