numbers converted to objects
<p>i'm having trouble with some javascripting, where some values that are apparantly numbers, suddenly turn into objects, and i can't figure out how or why.</p>

<p>codesnippets:</p>

<pre><code>addFigure("-1,1,-0.5_1,1,-0.5_0.5,-1,-0.5_-0.5,-1,-0.5");

function addFigure(t) {
        var fig = new figure();
        var v = t.split("_");

        var points = new Array();
        for (var i = 0; i &lt; v.length; i++) {
            var coords = v[i].split(",");
            var x = parseFloat(coords[0]);
            var y = parseFloat(coords[1]);
            var z = parseFloat(coords[2]);
            alert(typeof x + " " +typeof y)
            var point = new Point3D(x, y, z);
            alert(typeof point.x + " " + typeof point.y)
           //both alerts print out "number number"
           fig.addPoint(point);
        }


        figures.push(fig);
    }

        function figure() {
        this.points = new Array();
        this.addPoint = function (x, y, z) {
            var v = new Point3D(x, y, z);
            alert(typeof x + " " + typeof y)
//this alert prints out "Object undefined"
            this.points.push(v)
        }

        this.getPoints = function () { return this.points }

    }
</code></pre>
