Skip to content

Instantly share code, notes, and snippets.

var menu = {
width: 200,
height: 300,
title: "My menu"
};
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n)
}
<?php
function select($arr, $callback){
foreach ($arr as $value) {
if($callback($value))
yield $value;
}
}
$arr = [1, 2, 3, 4, 5, 6, 7, 8];
$select = select($arr, function($e){return $e % 2 == 0 ? true : false;});
$collect = collect($select, function($e){return $e * $e;});