I've been using a new method that I just learned for keeping outside scope inside of another function but I can't remember the term for the syntax used. Below is an example of how it works:
Api.get().then( (data) => {
console.log('do something with data', data);
}, ( e ) {
console.log('Error: ', e );
});
Basically, its a callback function but what is the term or name of this type of syntax. The reason I like using this is because you can still reference this and its values and methods, whereas using function( data ) would lose this context. I want to know the name or term of this syntax because it doesn't seem to be supported by iphone or safari and I would like to look further into support and documentation on support for this method.
(e) => {}arrow functionsdeveloper.mozilla.org/en-US/docs/Web/JavaScript/Reference/…. I knew it wasn't support just wanted to figure out what it was called so I could find out what browsers and versions were supporting it.