165 days ago · 9 min read1848 words · Tech · hide · Fediverse post

I am actually procrastinating on my reading with JavaScript. I never thought I'd actually do that, but, hey, it's reading about blockchain or it's learning JavaScript, and... well... yep. Besides, I have, like, two more things to tackle in Objects, so I might as well get those over with, huh? Man, though, I gotta remember all the JavaScript I did before. Whoops. Displaying ObjectsSo when you create an object and then try to display it, JavaScript goes "Oh, hey, that should be a string," and the object goes "No, I'm an object". const pokemon = { name: "Magikarp", type: "Water", move: "Splash" }; let character = pokemon; document.getElementById("demo").innerHTML = character; Which means that, because the girls are fighting, you get [object Object] There are a few ways to make it behave. Displaying Object PropertiesThe easiest is, really, just displaying all the properties. const pokemon = { name: "Magikarp", type: "Water", move: "Splash" }; let character = pokemon.name + ", " +…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town