This is in discord.js. So I have three items each with a unique price (more items in the future).. Sending the name of the item for example "Item 1" should reply the price. How do I use the price variable in my code? I was thinking associative array but I think there's no associate array in JS.
- Item 1 = 100
- Item 2 = 300
- Item 3 = 500
I have this code:
const items = ["Item 1", "Item 2", "Item 3"];
const price = [100, 300, 500];
for (var i=0; i < items.length; i++) {
if (message.content === items[i]) {
message.reply(PostPrice);
}
}