Skip to content

Instantly share code, notes, and snippets.

@think49
Last active September 25, 2015 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save think49/887049 to your computer and use it in GitHub Desktop.
Save think49/887049 to your computer and use it in GitHub Desktop.
is-object.js : Object型なら true を返し、他の型なら false を返す(ES6対応)
/**
* is-object.js
*
* @version 1.0.3
* @author think49
* @url https://gist.github.com/887049
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/
'use strict';
function isObject (value) {
return value !== null && typeof value !== 'undefined' && Object(value) === value;
}
@think49
Copy link
Author

think49 commented Mar 29, 2011

Object 型以外も判定したい場合は get-type.js を利用してみてください。

参考URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment