Skip to content

Instantly share code, notes, and snippets.

View Yigaue's full-sized avatar
🦍
building

Gospel Lekia Yigaue

🦍
building
View GitHub Profile
let newPrice = data.map((book) => book.price + 200);
console.log(newPrice);
// result:
// (4) [233, 212, 605, 750]
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"}
];
@Yigaue
Yigaue / ternary.php
Last active January 27, 2020 18:51
Ternary operators collection
<?php
/**
| The commented code shows the full code of the ternary equiv.
*/
// if ($age = 20 < 22)
// {