Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230523

Can't create alert inside onFail function of http request

$
0
0

A comment on this, which I imagine you probably know, but the OP probably doesn’t. Parentheses are mandatory if there’s more than one parameter.

function(x,y) { return x + y }
(x, y) => x + y

But if there’s only one parameter, the parentheses can be dropped because the compiler can still compile unambiguously.

function(x) { return x }
(x) => x
x => x

However, in the case of inheritance, where you’re defining a function to be used in an expression with super for example, you might need to use parentheses for a single parameter. That gets kinda complicated, and I don’t understand it well because I avoid using inheritance in Javascript.


Viewing all articles
Browse latest Browse all 230523


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>