What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-06 18:28:04
js save and load an array of different types into localstorage
var myArray = [1,"word",23,-12,"string"];//your list of values, they can be strings or numbers //SAVING function save(a,b,c,d,e) {//the number of parameters you add is how many items you save var itemArray = [a,b,c,d,e];//number of... Add solution -
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-25 04:49:02
lodash remove null from object
var person = {"name":"bill","age":21,"sex":undefined,"height":"crap"}; //remove undefined properties or other crap var cleanPerson = _.pickBy(person, function(value, key) { return !(value === u... Add solution
Best helpers
Ranking is empty