...and that's exactly what I said, if you're doing it for your own edification 😳
In my defense, I was half asleep and had never heard that word before, so I skipped over it. Not every day I learn a new word(was a bookworm as a kid and read parts of the dictionary for fun on occasion), so thanks for expanding my vocabulary!
There's just an id property, not itemID (nor itemId). You'd be right at a higher level function that was working from the item in question, but in this case the Game_Action's Item method returns a usableItem, not a Game_Item.
I had chased it all the way down to the BaseItem, so I think I got a little lost. I'm using Visual Studio Code with LunaLite type definitions for MZ, but sometimes it's not as helpful as I would like. Sometimes it throws another wrinkle in the rabbit chase, and I think that was part of my problem.
I think the actual issue was something else. I was passing my attempts at grabbing the id to a function that displayed the passed value in a message (just to make sure I'm getting what I'm after), it would either be blank or throw an error, depending on what I was trying. The function had another bit in it that did something referencing, but not changing, that value, so I left it.
I decided to console log the value before passing it just now, and it was logging the id with the item().id, but the message was still blank. I removed the extra bit of the function to simplify everything as much as possible, and it started working.
I finally tracked it down, and as usual, it's my experience with another programming language clashing with how javascript works. I had an if statement comparing the passed value to something else. Except in the expression I used "=", not "==", forgetting that in javascript, "=" does NOT do what I expect it to. So instead of referencing, I was overwriting until it BECAME blank. So when the simple method failed, I thought I was not grabbing the id correctly and started chasing the portal rabbit.
I may understand programming at a amateur hobbyist level, but a lot of my specific knowledge is in Visual Basic, and it handles things COMPLETELY differently to javascript with regards to variables, variable types, arrays, and the like. I slip for one second and use what I originally learned, I screw myself over without realizing it.
...I should really use console.log more often. Still not used to having that option available.