How we found an easy way to pass a user's API credentials from a web page to our iOS application to support single-account, multiple-login using WKWebView.
Constants pair well with JavaScript's powerful object data structure, and they can prevent all kinds of problems, including "Undefined is Not a Function."
JavaScript Promises are great, but there's a number of subtle misuses that can break them. We'll walk through some common mistakes and how to avoid them.
The best way to deal with asynchronous JavaScript is ES6 Promises. Here's an overview of JavaScript Promises, error catching, and how to make your own.