The map() method is similar forEach() method which means that it performs a function, however it returns a new array with the returned values. In this example we are going to perform the $1 discount of the oil prices using the map() method instead of the forEach() the difference here is that the map() method returns a new array instead of the original array, but the result will be the same.
<script>
var oilPrices = [70.15, 69.50, 71.23, 74.32, 76.99];
var discounted = oilPrices.map(function (value) { return value -1; });
console.log(discounted);
</script>
The code above calls the map() method on the oil prices and returns a discounted value of $1 for each array element
Thanks for your attention on the matter.
ReplyDeleteA0C50B5F54
ReplyDeletekiralık hacker
hacker arıyorum
kiralık hacker
hacker arıyorum
belek
4AC7669EDE
ReplyDeletekiralık hacker
hacker kirala
tütün dünyası
-
-
D63432E7
ReplyDeleteKırşehir Esçort
Bilecik Esçort
Maraş Esçort
Balıkesir Esçort
Kilis Esçort
Burdur Esçort
Batman Esçort
Şırnak Esçort
Nevşehir Esçort
E9965A49
ReplyDeleteSivas
Niğde
Bartın
Bingöl
Çorum
Kırıkkale
Ordu
Edirne
Karabük
19BEB304
ReplyDeleteCebeci
Bergama
Bitez
Birecik
Aktepe
Çayırova
Seyhan
Tavşanlı
Yalıkavak