Off to the bazaar
Let's build a little grocery list manager. It keeps item names and prices in two arrays, and gives you functions to add items, remove them and work out the total.
Two lists side by side
const items = ["rice", "lentils"];
const prices = [150, 120];
for (let i = 0; i < items.length; i++) {
console.log(`${items[i]}: Rs ${prices[i]}`);
}In Unit 7 you'll learn a neater way — objects — to keep a name and price together. For now, two arrays work fine.