What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-08-29 15:02:03
Detect the city on application launch via geolocation react native
navigator.geolocation.getCurrentPosition((geo) => console.log(geo)) // or using lib import Geolocation from '@react-native-community/geolocation'; Geolocation.getCurrentPosition(info => console.log(info)); Add solution -
Javascript 2021-08-29 14:19:01
javascript element vs node
/** * Node Object: node is the generic name for any type of object in the DOM hierarchy. * Element Object: An element is one specific type of node as there are many other types of nodes (text nodes, comment nodes, document nodes, etc...). * * Types of nod... Add solution -
Javascript 2021-08-29 10:36:01
node wait 10 seconds
async function init() { console.log(1); await sleep(1000); console.log(2); } function sleep(ms) { return new Promise((resolve) => { setTimeout(resolve, ms); }); } // one liner let sleep = ms => new Promise(resolve => setTimeout(re... Add solution -
Javascript 2021-08-29 09:42:01
Writing files in Node.js
const fs = require('fs'); fs.writeFile("/tmp/test", "Hey there!", function(err) { if(err) { return console.log(err); } console.log("The file was saved!"); }); // Or fs.writeFileSync('/tmp/test-sync', 'H... Add solution -
Javascript 2021-08-29 09:21:02
javascript object to array
var obj = {"1":5,"2":7,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0} var result = Object.keys(obj).map(function(key) ... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5