//superCounter("Count me in");
//{"words": 3, "chars": 11, "avgLength": 3, "spaces": 2}
// var paramText = "Count me in";
// var superCounter = function(paramText) {
//
// var names = paramText.split(" ");
//
// var words = names.length;
// var chars = paramText.toString().length; // chars
// var spaces = names.length - 1;
// var avgLength = (chars - spaces) / words;
//
// return "words : " + words +  ", chars : " + chars + ", avgLength : " + avgLength + ", spaces: " + spaces  ;
// }
//
// console.log(superCounter(paramText));

//Well, that was not what I meant but glad to see you do understand objects. I meant instead of returning the string at the end of the function, have it return an object with all of those keys/values. Remove all quotations from your return value.


var Util = {
  // Util.paramText = "Count me in";
  superCounter : function(paramText) {
    var names = paramText.split(" ");

    var words = names.length;
    var chars = paramText.toString().length; // chars
    var spaces = names.length - 1;
    var avgLength = (chars - spaces) / words;

    return "words : " + words +  ", chars : " + chars + ", avgLength : " + avgLength + ", spaces: " + spaces  ;
  }

}

console.log(Util.superCounter("Count me in"));

@@ -775,17 +775,300 @@
 value.%0A%0A
-%0A
+// var test = %7B%0A//     'type' : 'news',%0A//     'name' : 'article1'%0A// %7D;%0A//%0A// function showObject(obj) %7B%0A//   var result = %22%22;%0A//   for (var p in obj) %7B%0A//     if( obj.hasOwnProperty(p) ) %7B%0A//       result += p + %22 , %22 + obj%5Bp%5D + %22%5Cn%22;%0A//     %7D%0A//   %7D%0A//   return result;%0A// %7D%0A//%0A// 
 var Util
@@ -1072,16 +1072,19 @@
 til = %7B%0A
+// 
   // Uti
@@ -1112,16 +1112,21 @@
 me in%22;%0A
+//   
   superC
@@ -1156,16 +1156,22 @@
 Text) %7B%0A
+//%0A// 
     var 
@@ -1200,17 +1200,19 @@
 t(%22 %22);%0A
-%0A
+// 
     var 
@@ -1233,16 +1233,19 @@
 length;%0A
+// 
     var 
@@ -1290,16 +1290,19 @@
 / chars%0A
+// 
     var 
@@ -1328,16 +1328,19 @@
 th - 1;%0A
+// 
     var 
@@ -1377,17 +1377,22 @@
  words;%0A
-%0A
+//%0A// 
     retu
@@ -1499,16 +1499,29 @@
   ;%0A
+// 
   %7D%0A
-%0A%7D%0A%0A
+//%0A// %7D%0A//%0A// 
 cons
@@ -1559,12 +1559,539 @@
 t me in%22));%0A
+%0A%0A%0A// except return object %7B%22words%22: 3, %22chars%22: 11, %22avgLength%22: 3, %22spaces%22: 2%7D%0Avar superCounter = function(paramText) %7B%0A%0A  var names = paramText.split(%22 %22);%0A  var words = names.length;%0A  var spaces = names.length - 1;%0A  var chars = paramText.toString().length; // chars%0A%0A  //object to return%0A  var counterObject = %7B%0A    'words': words,%0A    'chars': chars,%0A    'avgLength': (chars - spaces) / words,%0A    'spaces': spaces%0A  %7D;%0A%0A  return counterObject;%0A%0A%7D; //end superCounter function%0A%0Aconsole.log(superCounter(%22Count me in%22))%0A

Return javascript object instead of function string value