From d2c1667db759e66229f5f3a7eaa915b018497910 Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Thu, 29 Oct 2015 17:19:29 +0530 Subject: [PATCH] for loop clarification - fix typo - variable - Instruction clarification - Example clarification --- challenges/basic-javascript.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index b22ee617c7..6f7fa03251 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -868,16 +868,16 @@ "The most common type of JavaScript loop is called a \"for loop\" because it runs \"for\" a specific number of times.", "For loops are declared with three optional expressions seperated by semicolons:", "for([initialization]; [condition]; [final-expression])", - "The initialization statement is executed one time only before the loop starts. It is typically used to define and setup your loop varaible.", - "The condition statement is evaluated at the beginning of every loop and will continue as long as it evalutes true. When condition is false at the start of the loop, the loop will stop executing. This means if condition starts as false, your loop will never execute.", + "The initialization statement is executed one time only before the loop starts. It is typically used to define and setup your loop variable.", + "The condition statement is evaluated at the beginning of every loop iteration and will continue as long as it evalutes to true. When condition is false at the start of the iteration, the loop will stop executing. This means if condition starts as false, your loop will never execute.", "The final-expression is executed at the end of each loop iteration, prior to the next condition check and is usually used to increment or decrement your loop counter.", - "We'll initialize with i = 0 and loop while our condition i < 5 is true. We'll increment i by 1 each loop with i++ as our final-expression.", + "In the following example we initialize with i = 0 and iterate while our condition i < 5 is true. We'll increment i by 1 in each loop iteration with i++ as our final-expression.", "var ourArray = [];", "for(var i = 0; i < 5; i++) {", "  ourArray.push(i);", "}", - "ourArray will now contain [0,1,2,3,4] ", - "Let's try getting a for loop to work by pushing values to an array." + "ourArray will now contain [0,1,2,3,4].", + "Let's try getting a for loop to work by pushing values to an array." ], "tests": [ "assert(editor.getValue().match(/for\\s*\\(/g).length > 1, 'message: You should be using a for loop for this.');",