This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let newPrice = data.map((book) => book.price + 200); | |
console.log(newPrice); | |
// result: | |
// (4) [233, 212, 605, 750] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let data = [ | |
{id: 1, title: "Don't Waste your life ", price: 33, Author: "John Piper"}, | |
{id: 2, title: "Living for a greater purpose", price: 12, Author: "JH Baritam"}, | |
{id: 3, title: "The call for Mercy", price: 405, Author: "Lekia Yiga"}, | |
{id: 4, title: "Heart Blindness", price: 550, Author: "Unknown author"} | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
| The commented code shows the full code of the ternary equiv. | |
*/ | |
// if ($age = 20 < 22) | |
// { |
NewerOlder