Skip to content
Browse files

more operators

  • Loading branch information...
1 parent afc1010 commit 0799437956a8f4d1ab32404efc46055c535e20a2 @namman committed Sep 26, 2013
Showing with 15 additions and 4 deletions.
  1. +15 −4 jsl/resources/tests.js
View
19 jsl/resources/tests.js
@@ -195,6 +195,12 @@ test("Object literals are lists of property and object pairs", function () {
ok(myNestedObjectLiteral.firstName.dog2 == "Louis");
});
+test("Javascript can display unicode literals", function () {
+ var x = "\u00B2";
+ console.log(x);
+ ok(true);
+});
+
test("The strict equal operator returns true if the operands are equal and have the same type", function () {
var string10 = "10";
var int10 = 10;
@@ -254,13 +260,18 @@ test("The 'in' operator returns true if the specified property is in the specifi
ok("make" in myCar);
});
-test("Javascript can display unicode literals", function () {
- var x = "\u00B2";
- console.log(x);
- ok(true);
+test("The 'instanceOf' operator returns true of the specified object is of the specified type", function () {
+ var myDate = new Date(2010,12,17);
+ ok(myDate instanceof Date);
+ var myString = new String("my string");
+ ok(myString instanceof String);
+ var myStringLiteral = "my implicit string";
+ ok((myStringLiteral instanceof String) == false);
});
+
+

0 comments on commit 0799437

Please sign in to comment.
Something went wrong with that request. Please try again.