Skip to content
Advertisement

Tag: loops

Javascript – Looping an object inside an loop

Not sure if I am phrasing this exactly but I have an object that I want to create a variable from to then append to a div in a page. I am doing this in javascript / Jquery. The object: Then I loop it to get the data but want to create a var of html to then append but

Converting nested loops into forEach();

Im trying to learn forEach() method but i cant find more advanced examples. So i thought about refactoring my Codewars code to learn from it. I dont know know to properly use forEach method in nested loops. Hope You can help me learn from this example 🙂 6 kyu – Replace With Alphabet Position https://www.codewars.com/kata/546f922b54af40e1e90001da/train/javascript Answer (Note: @Terry’s solution is

Tile drawing is not displaying

I’m working on this code where if you put in certain characters for the map array, the canvas will display the image corresponding to that character. I have an array for all the ground blocks, at the top. Here’s my code so far: However, nothing seems to be drawing to the screen. I believe this might be a problem with

Advertisement