I’m coming from processing to p5js and looking for HashMap functionality.
I’m using node.js and did npm install hashmap
in my test sketch, doing var hm = new HashMap(); inside setup() prevents my sketch from working. Not sure how to go about debugging this as I’m very new to javascript, doing npm list shows hashmap is installed.
nevermind, I guess every array is a hashmap.
how can I get the size of an array when it has string keys? .length doesn’t work. I read to use jquery to get .size() for arrays, i did npm install jquery but get “TypeError: spriteAtlas.size is not a function”
found solution, Object.keys(spriteAtlas).length