From 78114800aea83752bf967b94514682ad036e5bc0 Mon Sep 17 00:00:00 2001 From: vijayB <88872426+vijay451@users.noreply.github.com> Date: Tue, 9 Aug 2022 10:41:09 +0530 Subject: [PATCH] Update about_arrays.js --- topics/about_arrays.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/topics/about_arrays.js b/topics/about_arrays.js index b2de2547..f9d4b04d 100644 --- a/topics/about_arrays.js +++ b/topics/about_arrays.js @@ -2,23 +2,23 @@ module("About Arrays (topics/about_arrays.js)"); test("array literal syntax and indexing", function() { var favouriteThings = ["cellar door", 42, true]; // note that array elements do not have to be of the same type - equal(__, favouriteThings[0], 'what is in the first position of the array?'); - equal(__, favouriteThings[1], 'what is in the second position of the array?'); - equal(__, favouriteThings[2], 'what is in the third position of the array?'); + equal(cellar door, favouriteThings[0], 'what is in the first position of the array?'); + equal(42, favouriteThings[1], 'what is in the second position of the array?'); + equal(true, favouriteThings[2], 'what is in the third position of the array?'); }); test("array type", function() { - equal(__, typeof([]), 'what is the type of an array?'); + equal(string, typeof([]), 'what is the type of an array?'); }); test("length", function() { var collection = ['a','b','c']; - equal(__, collection.length, 'what is the length of the collection array?'); + equal(3, collection.length, 'what is the length of the collection array?'); }); test("splice", function() { var daysOfWeek = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; - var workingWeek = daysOfWeek.splice(__, __); + var workingWeek = daysOfWeek.splice(5, 2); var weekend = daysOfWeek; deepEqual(workingWeek, ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], 'what is the value of workingWeek?'); @@ -30,8 +30,8 @@ test("stack methods", function() { stack.push("first"); stack.push("second"); - equal(__, stack.pop(), 'what will be the first value popped off the stack?'); - equal(__, stack.pop(), 'what will be the second value popped off the stack?'); + equal("second", stack.pop(), 'what will be the first value popped off the stack?'); + equal("first", stack.pop(), 'what will be the second value popped off the stack?'); }); test("queue methods", function() { @@ -40,6 +40,6 @@ test("queue methods", function() { queue.push("second"); queue.unshift("third"); - equal(__, queue.shift(), 'what will be shifted out first?'); - equal(__, queue.shift(), 'what will be shifted out second?'); + equal("third", queue.shift(), 'what will be shifted out first?'); + equal("first", queue.shift(), 'what will be shifted out second?'); });