So I am working in a converter application powered by JavaScript, and right now I am trying to create a huge object with all the measures. But whenever I debug it, it's saying things like:
Expected ';' and instead saw '.' (var units.length = {};) Expected '.' at column 1, not column 10 (var units.length = {};) Unexpected '.' (var units.length = {};) etc.
It's been a long time since I coded in JS, so I'm having some confusion with it, would appreciate any help, here's the code:
var units = {};
var units.length = {};
var units.time = {};
var units.mass = {};
var units.temperature = {};
//Starting with Length
units.length.meter = 1;
units.length.meters = 1;
units.length.inch = 0.0254;
units.length.inches = 0.0254;
units.length.foot = 0.3048;
units.length.feet = 0.3048;
units.length.yard = 0.9144;
units.length.yards = 0.9144;
units.length.mile = 1609.344;
units.length.miles = 1609.344;
...
var units.lengthis simply not valid JS. Drop thevar, just like you did forunits.length.meter = 1;.