DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
  • Infrastructure
    • can-construct
    • can-control
    • can-event
    • can-event/async/async
    • can-event/batch/batch
    • can-observation
    • can-simple-map
    • can-util
      • can-util/dom
      • can-util/js
        • ./assign/
        • ./base-url/
        • ./cid/
        • ./deep-assign/
        • ./defaults/
        • ./deparam/
        • ./diff/
        • ./diff-object/
        • ./each/
        • ./global/
        • ./import/
        • ./is-array-like/
        • ./is-browser-window/
        • ./is-empty-object/
        • ./is-function
        • ./is-node/
        • ./is-plain-object/
        • ./is-promise/
        • ./is-promise-like/
        • ./is-string/
        • ./is-web-worker/
        • ./join-uris/
        • ./make-array/
        • ./make-promise/
        • ./param/
        • ./set-immediate/
        • ./string/
        • ./string-to-any/
        • ./types/
    • can-view-callbacks
    • can-view-live
    • can-view-model
    • can-view-nodelist
    • can-view-parser
    • can-view-scope
    • can-view-target
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Infrastructure
  • /
  • can-util
  • /
  • can-util/js
  • /
  • ./is-empty-object/
  • / On this page
    • isEmptyObject

      module
      • source

      isEmptyObject(obj)

      Used to determine if an object is an empty object (an object with no enumerable properties) such as {}.

      var isEmptyObject = require("can-util/js/is-empty-object/is-empty-object");
      
      console.log(isEmptyObject({})); // -> true
      
      console.log(isEmptyObject({ a: 1 })); // -> false
      
      var obj = {};
      Object.defineProperty(obj, "foo", {
          enumerable: false,
          value: "bar"
      });
      console.log(isEmptyObject(obj)); // -> true
      

      Parameters

      1. obj {Object}:

        Any object.

      Returns

      {Boolean}:

      True if the object is an object with no enumerable properties.

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.