phpjs
Version:
11 lines (10 loc) • 364 B
JavaScript
function sizeof(mixed_var, mode) {
// From: http://phpjs.org/functions
// + original by: Philip Peterson
// - depends on: count
// * example 1: sizeof([[0,0],[0,-4]], 'COUNT_RECURSIVE');
// * returns 1: 6
// * example 2: sizeof({'one' : [1,2,3,4,5]}, 'COUNT_RECURSIVE');
// * returns 2: 6
return this.count(mixed_var, mode);
}