table.insert Syntax For Tables Not Numerically Indexed

I was having some issues with the table.insert syntax for dictionary tables (indexed by strings). When I try to insert into a table using:

table.insert(table, 1, [foo]="bar")  

Corona says “unexpected symbol near’[’”… but how else can I enter something into the table using “foo” as the index?

Am I doing something wrong here? Is there possibly another method to insert values into a dictionary table? [import]uid: 48775 topic_id: 8684 reply_id: 308684[/import]

Am hoping to use this to manage inventory if that helps.

I.E

Invtable = {item1 = 4, item2 = 0, item3 = 32}

Open to other ideas. [import]uid: 48775 topic_id: 8684 reply_id: 31729[/import]