var prompt = require('prompt');
prompt.start();

var obj = {
  password: 'lamepassword',
  mindset: 'NY'
}

//
// Log the initial object.
//
console.log('Initial object to be extended:');
console.dir(obj);

//
// Add two properties to the empty object: username and email
//
prompt.addProperties(obj, ['username', 'email'], function (err) {
  //
  // Log the results.
  //
  console.log('Updated object received:');
  console.dir(obj);
});

//console.log(obj); // this prints the old "obj" value, before the prompt and update - WTF? do I need to nest further results from the prompt within the first prompt call? That could get into a deep hole with repeated calls...
@@ -1,667 +1,942 @@
-var prompt = require('prompt');%0Aprompt.start();%0A%0Avar obj = %7B%0A  password: 'lamepassword',%0A  mindset: 'NY'%0A%7D%0A%0A//%0A// Log the initial object.%0A//%0Aconsole.log('Initial object to be extended:');%0Aconsole.dir(obj);%0A%0A//%0A// Add two properties to the empty object: username and email%0A//%0Aprompt.addProperties(obj, %5B'username', 'email'%5D, function (err) %7B%0A  //%0A  // Log the results.%0A  //%0A  console.log('Updated object received:');%0A  console.dir(obj);%0A%7D);%0A%0A//console.log(obj); // this prints the old %22obj%22 value, before the prompt and update - WTF? do I need to nest further results from the prompt within the first prompt call? That could get into a deep hole with repeated calls...
+%0AseparateComma(123);%0AseparateComma(1234);%0AseparateComma(12345);%0AseparateComma(123456789);%0AseparateComma(1234567891);%0A%0Afunction separateComma (number)%0A%7B%0A%0A  var numberString = number.toString();%0A  var numArray = %5B%5D;%0A  var numWithCommas = %22%22;%0A%0A  if (numberString.length %3E 3)%0A  %7B%0A%0A      var indexCount = 0;%0A      //declaring indexCount outside of the for loop so the variable%0A      //updates are saved outside of the loop%0A%0A      for (var i = numberString.length-1; i %3E= 0; i --)//counting down to reverse the index of the string%0A      %7B%0A        if( (indexCount != 0) && (indexCount %25 3 == 0) )%0A        %7B%0A          numArray.push(numberString.charAt(i) + %22,%22);%0A          indexCount +=1;%0A        %7D%0A        else%0A        %7B%0A          numArray.push(numberString.charAt(i));%0A          indexCount += 1;%0A        %7D%0A      %7D%0A%0A    var numWithCommas = numArray.reverse().join(%22%22);%0A%0A    console.log(numWithCommas);%0A  %7D%0A  else%0A  %7B%0A    console.log(number);%0A  %7D%0A%0A%7D%0A

Update files