What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-30 09:48:03
how to find length of string in javascript without using length method
function strLength(s) { var length = 0; while (s[length] !== undefined){ length++; } return length; } console.log(strLength("Hello")); // 5 console.log(strLength("")); // 0 Add solution -
Javascript 2021-09-30 09:45:05
how to manage logging using winston for production and development in node js "github"
const winston = require('winston'); const { createLogger, format, transports } = require('winston'); const dotenv = require('dotenv'); dotenv.config(); var logger = createLogger({ level: 'info', format: format.combine( format.timestamp({... Add solution -
Javascript 2021-09-28 11:36:02
typescript filter array of null
function notEmpty<TValue>(value: TValue | null | undefined): value is TValue { return value !== null && value !== undefined; } const array: (string | null)[] = ['foo', 'bar', null, 'zoo', null]; const filteredArray: string[] = array.fil... Add solution -
Javascript 2021-09-08 20:45:02
match property js
const matchProperty = (data, compare) => { let compareIn = Object.keys(compare) let inData = Object.keys(data) const newInData = inData .slice(0, compareIn.length) .map((v, i) => { if (v !== compareIn[i]) { return compareIn[i] } }... Add solution -
Javascript 2021-09-01 13:34:03
localStorage is not defined NextJS
// components function Storage(props) { const LocalStorage = ({ type, keys, value, onLocalStorage }) => { switch (type) { case 'set': keys !== undefined && window.localStorage.setItem(keys, value) break case 'get': keys !==... Add solution
Best helpers
Ranking is empty