Skip to content
Browse files

operators

  • Loading branch information...
1 parent 48bfda2 commit 7ba4d90682d45d6195f4e2234754b878a53820aa Nick Miller committed Sep 19, 2013
Showing with 31 additions and 0 deletions.
  1. +31 −0 jsl/resources/tests.js
View
31 jsl/resources/tests.js
@@ -193,6 +193,37 @@ test("Object literals are lists of property and object pairs", function () {
}
ok(myNestedObjectLiteral.firstName.dog2 == "Louis");
+});
+
+test("The strict equal operator returns true if the operands are equal and have the same type", function () {
+ var string10 = "10";
+ var int10 = 10;
+ var anotherInt10 = 10
+ ok(string10 == int10);
+ ok(string10 !== int10);
+ ok(anotherInt10 === int10);
+
+});
+
+test("Divide by zero produces infinity", function () {
+ var shouldBeInfinity = 10/0;
+ ok(shouldBeInfinity == Infinity);
+ ok(shouldBeInfinity === Infinity);
+});
+
+
+test("Javascript has ternary opeartory", function () {
+ var age = 17;
+ var desc = age < 18 ? "minor" : "adult";
+ ok(desc == "minor")
+
+});
+
+test("Delete operator deletes an object, property or removes an element from an array", function () {
+ var myObj = new Number();
+ ok(myObj != undefined);
+ var successFullyDeleted = delete myObj;
+ console.log("Successfully deleted: " + successFullyDeleted);
});

0 comments on commit 7ba4d90

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