What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-23 10:11:10
Getting One Value from an Array of Items
//Getting One Value from an Array of Items or sum of array var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; var total = numbers.reduce(function(total, current) { return total + current; }, 0); console.log(total); Add solution -
PHP 2021-08-27 16:40:02
sum of associative array in php
<?php $items = [ ['label' => 'cake', 'name' => 'Cake', 'price' => 150], ['label' => 'pizza', 'name' => 'Pizza', 'price' => 250], ['label' => 'puff', 'name' => 'Veg Puff', 'price' => 20], ['label' => 'samosa... Add solution