Redux May not be persistent. Local Storage Shared between all tabs and windows from the same origin. The data does
Category: Javascript
NodeJS set time out for an API call
https://stackoverflow.com/questions/63248292/how-to-set-a-time-limit-to-a-method-in-nodejs Following code snippet demonstrates the usage of timeout function written above. It mocks a api request that returns a response after
Javascript object conversions
String to object const obj = JSON.parse(‘{“name”:”John”, “age”:30, “city”:”New York”}’); Copy object (not just put another pointer to it) let
Javascript Equivalent…
PHP preg_replace let phone=”+17778889999″; let p=phone.replace(/^\+1/,”); PHP isset if (typeof variable !== ‘undefined’) PHP array_pop path_arr.splice(-1,1); //note does not work
Javascript Debugging Tips
To dump out random objects console.log(JSON.stringify(obj)) if that didn’t work: console.log(“my object: %o”, obj); A straight console.log(obj) will often show
Javascript sleep function
Unlike the setTimeOut (functionName, delay) method which places the functionName in a queue then execute it after delay miliseconds, The
Okta Event Hooks
What are the Okta Event Hooks: Event Hooks are Okta’s implementation of the industry concept of webhooks Event Hooks are
Chrome Javascript Quick Note
To start Javascript console in Chrome: <ctrl><shift>J To force a hard refresh (which resets the javascript state, not just PHP’s)