Im playing around with NG2 and I am looking for the equivalent of angular.isArray
.
Yes, I tried to google it but no luck. Im probably thinking about this problem.
The method I try to use in my ng2-app is this:
function periodsFormat(dates, func) {
if (!angular.isArray(dates)) { return func(dates); }
return dates.map(func).join('-');
}
Surely it should work if I manage to replace (!angular.isArray...
with something NG2-ish. Thank you!
Update:
Thank you both, I ended doing this:
function periodsFormat(dates, func) {
if (!Array.isArray(dates)) { return func(dates); }
return dates.map(func).join('-');
}