Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

average in array

Route::get('/', function () {

     $data = [
        ["price" => 10],
        ["price" => 20],
        ["price" => 30]
    ];
  return collect($data)->average("price"); 

});
Source by www.codecheef.org #
 
PREVIOUS NEXT
Tagged: #average #array
ADD COMMENT
Topic
Name
4+7 =