In this case 18 is returned. ...In TypeScript:
var ages = [3, 10, 18, 20];
let whatever = ages.find(x => x > 17);
alert(whatever);
In JavaScript:
var ages = [3, 10, 18, 20];
var whatever = ages.find(function (x) { return x > 17; });
alert(whatever);
No comments:
Post a Comment