• f_each

          Iterate the object ( including <Array> ) obj and execute the function fn for each value in the object. The key is give to 1st argument for the function fn and the value is given to 2nd argument. If return false, stop the iterating.
          • f_each_ex

            var f = window.foonyah;
            var obj = { a: 1, b: 2, c: 3 };
            f.each(obj, function(k, v) {
            console.log(k + ':' + v);
            return k != 'b';
            });
            // a:1
            // b:2

        • f_isfunction

          Judge the type of x is <Function> or not.
          var f = widow.foonyah;
          var x = Function(), y = {}, z = [];
          console.log(f.isFunction(x), f.isFunction(y), f.isFunction(z))
          // true, false, false

          • f_isfunction_ex

            var f = window.foonyah;
            var x = Function(), y = {}, z = [];
            console.log(f.isFunction(x), f.isFunction(y), f.isFunction(z))
            // true, false, false

        • f_isarray

          Judge the type of x is <Array> (NOT including <Object>) or not.
          var f = widow.foonyah;
          var x = Function(), y = {}, z = [];
          console.log(f.isArray(x), f.isArray(y), f.isArray(z))
          // false, false, true

          • f_isarray_ex

            var f = window.foonyah;
            var x = Function(), y = {}, z = [];
            console.log(f.isArray(x), f.isArray(y), f.isArray(z))
            // false, false, true

        • f_isplainobject

          Judge the type of x is <key-value Object> (NOT including some instance, null) or not.
          var f = widow.foonyah;
          var x = Function(), y = {}, z = new Function();
          console.log(f.isPlainObject(x), f.isPlainObject(y), f.isPlainObject(z))
          // false, true, false

          • f_isplainobject_ex

            var f = window.foonyah;
            var x =null, y = {}, z = new Function();
            console.log(f.isPlainObject(x), f.isPlainObject(y), f.isPlainObject(z))
            // false, true, false

        • f_type

          Return the type of x with some extended type compare with JavaScript typeof.

          f.typeof(undefined)undefined
          f.typeof(null)null
          f.typeof('ABC')string
          f.typeof(123)number
          f.typeof(function(){ })function
          f.typeof({})object
          f.typeof([])array
          f.typeof(new f.Emitter())object
          var f = widow.foonyah;
          var x = Function(), y = {}, z = null
          console.log(f.type(x), f.type(y), f.type(z))
          // false, true, false

          • f_type_ex

            f.typeof(undefined)undefined
            f.typeof(null)null
            f.typeof('ABC')string
            f.typeof(123)number
            f.typeof(function(){ })function
            f.typeof({})object
            f.typeof([])array
            f.typeof(new f.Emitter())object
            var f = window.foonyah;
            var x = Function(), y = {}, z = null
            console.log(f.type(x), f.type(y), f.type(z))
            // false, true, false

        • f_is

          Judge the type of x equals type.
          If x is an jQuery wrapped object, type is treated as an selector and returns jQuery.fn.is(type) result.
          • f_is_ex

            var f = window.foonyah;
            var x = Function();
            console.log(f.is('function', x), f.is('object', x), f.is('div', $('<div/>')))
            // true, false, true

        • f_noop

          Returns no-operation function. ( feature: with returns x or undefined. )
          var f = widow.foonyah;
          console.log(f.noop()());
          console.log(f.noop(1)()); // next feature
          // undefined
          // 1

          • f_noop_ex

            var f = window.foonyah;
            console.log(f.noop()());
            console.log(f.noop(1)()); // next feature
            // undefined
            // 1

        • f_es6promise

          • f_es6promise_ex

            var f = window.foonyah;
            var x = $.Deferred();
            /* You can use Ecma Script Promise chain after the wrap. */
            f.es6promise(x.promise()).then(function(){
            return new Promise(function(rsl){
            setTimeout(rsl, 3000);
            });
            })['catch'](fucntion(e){
            // error handling
            console.log(e);
            });
        • f_jquerify

          • f_jquerify_ex

            var f = window.foonyah;
            var x = new Promise(function(rsl){ setTimeout(rsl, 3000) });
            // You can use jQuery.Deferred chain after the wrap.
            f.jquerify(x).pipe(function(){
            return $.Deferred().resolve()
            }).progress(function(){
            // some notification receiver
            console.log(arguments);
            });
        • f_emitterPromise

          > 0.9.10
          Wrap event emitter by Ecma Script 6 Promise resolves with the first argument of the last "data" event or last "end", and catch error event then will be rejected.
          • f_emitterPromise_ex

            var f = window.foonyah;
            var ee = new Emitter(); // browser-emitter, implemented by foonyah
            /* You can use promise chain for event. */
            f.emitterPromise(ee).then(function(r) {
            console.log('End Event:', r); // => 1
            })['catch']( function(e) { console.log('Error Event:', e) })
            setTimeout(function() {
            ee.emit('end', 1);
            }, 3000)
        • f_funcstringify

          Convert a function fn to string with using word-map replace.
          • f_funcstringify_ex

            var f = window.foonyah;
            var x = function() { console.log('a') }
            console.log(f.funcStringify(x));
            // console.log('a')