mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
documentation for Underscore 0.4.7, with isDate, isNaN, and isNull
This commit is contained in:
@@ -36,6 +36,7 @@ $(document).ready(function() {
|
||||
ok(_(moe).isEqual(clone), 'OO-style deep equality works');
|
||||
ok(!_.isEqual(5, NaN), '5 is not equal to NaN');
|
||||
ok(_.isEqual(NaN, NaN), 'NaN is equal to NaN');
|
||||
ok(_.isEqual(new Date(100), new Date(100)), 'identical dates are equal');
|
||||
});
|
||||
|
||||
test("objects: isEmpty", function() {
|
||||
@@ -75,6 +76,25 @@ $(document).ready(function() {
|
||||
ok(_.isFunction(_.isFunction), 'but functions are');
|
||||
});
|
||||
|
||||
test("objects: isDate", function() {
|
||||
ok(!_.isDate(100), 'numbers are not dates');
|
||||
ok(!_.isDate({}), 'objects are not dates');
|
||||
ok(_.isDate(new Date()), 'but dates are');
|
||||
});
|
||||
|
||||
test("objects: isNaN", function() {
|
||||
ok(!_.isNaN(undefined), 'undefined is not NaN');
|
||||
ok(!_.isNaN(null), 'null is not NaN');
|
||||
ok(!_.isNaN(0), '0 is not NaN');
|
||||
ok(_.isNaN(NaN), 'but NaN is');
|
||||
});
|
||||
|
||||
test("objects: isNull", function() {
|
||||
ok(!_.isNull(undefined), 'undefined is not null');
|
||||
ok(!_.isNull(NaN), 'NaN is not null');
|
||||
ok(_.isNull(null), 'but null is');
|
||||
});
|
||||
|
||||
test("objects: isUndefined", function() {
|
||||
ok(!_.isUndefined(1), 'numbers are defined');
|
||||
ok(!_.isUndefined(null), 'null is defined');
|
||||
|
||||
@@ -34,8 +34,8 @@ $(document).ready(function() {
|
||||
var expected = ["all", "any", "bind", "bindAll", "breakLoop", "clone", "compact",
|
||||
"compose","defer", "delay", "detect", "each", "every", "extend", "filter", "first",
|
||||
"flatten", "foldl", "foldr", "forEach", "functions", "head", "identity", "include",
|
||||
"indexOf", "inject", "intersect", "invoke", "isArray", "isElement", "isEmpty", "isEqual",
|
||||
"isFunction", "isNumber", "isString", "isUndefined", "keys", "last", "lastIndexOf", "map", "max",
|
||||
"indexOf", "inject", "intersect", "invoke", "isArray", "isDate", "isElement", "isEmpty", "isEqual",
|
||||
"isFunction", "isNaN", "isNull", "isNumber", "isString", "isUndefined", "keys", "last", "lastIndexOf", "map", "max",
|
||||
"methods", "min", "pluck", "range", "reduce", "reduceRight", "reject", "rest", "select",
|
||||
"size", "some", "sortBy", "sortedIndex", "tail", "template", "toArray", "uniq",
|
||||
"uniqueId", "values", "without", "wrap", "zip"];
|
||||
|
||||
Reference in New Issue
Block a user