I don’t know if this is purposeful or not (maybe we shouldn’t be able to create data structures?), but I’m unable to create an array in both the “Gridmancer” and the “It’s a trap!” levels.
This is the line of code being used:
var mycars = new Array();
This is the error message:
TypeError: undefined is not a function
Also, the ability to create functions would be really useful for the “Gridmancer” level.
1 Like
SirArt
January 2, 2014, 7:26pm
3
I was able to create one like this:
var my_array = [];
Try that and see if it works for you.
1 Like
SirArt
January 2, 2014, 7:29pm
4
Also, with respect to functions, I was able to create them like this:
this.myFunction = function(arg1, arg2) {
this.say('arg1: ' + arg1 + ', arg2: ' + arg2);
};
// try out your function
this.myFunction("arg1", "arg2");
Give that a shot. You’re right–without functions or arrays you are going to be very frustrated trying to complete gridmancer
1 Like
Thank you. I’ve never made anything in javascript before.
nick
January 4, 2014, 4:14am
6
I see the problem and have added an issue over here: https://github.com/codecombat/aether/issues/3
Basically I think I just need to extend the Aether transpiler to realize that things like Array should be valid identifiers. It’s on my list.
Thanks for the bug report!