As recommended in the thread I made a few days ago, I started taking the courses for JS on codecademy, and it's great! I've learned so much in just a few days, though I already had a basic understanding of programming since I also know a bit of ruby.
In order to pass time, I go a bit out of my way on codecademy's interactive tutorials, and on the "breather" pages I start to program random small things. Here's what I wrote for this particular piece of advice:
In order to pass time, I go a bit out of my way on codecademy's interactive tutorials, and on the "breather" pages I start to program random small things. Here's what I wrote for this particular piece of advice:
Code:
var map = [ [1, 2, 3], //Y1 [4, 5, 6], //Y2 [7, 8, 9] //Y3];var locate = [1, 1];var callMap = function(){ for (var loc1 = 0; loc1 < map.length; loc1++){ if (locate[0] == loc1){ for (var loc2 = 0; loc2 < map[loc1].length; loc2++){ if (locate[1] == [loc2]){ map[loc1][loc2] = "here"; } else { map[loc1][loc2] = map[loc1][loc2]; } } } } for (var i = 0; i < map.length; i++){ console.log(map[i]); }};