Property names with spaces in object literals

javascript, object

Solution

Sure, there can be spaces in property names, but then you have to enclose them in `"`:

var meow    = {
            "one meow": function (t) { return "a"; },
            two:        function (t) { return "b"; },
            three:      function (t) { return "c"; }
            };

When you want to access that property later, use the bracket syntax:

console.log( meow["one meow"]() );

Problem

I'm just wondering, with the "one", "two", "three" stuff, could there be a space? So instead of "one" it could be "one meow"? ``` var meow = { one: function (t) { return "a"; }, two: function (t) { return "b"; }, three: function (t) { return "c"; } }; ```

Original source