Mitch Mitch - 6 months ago 36
jQuery Question

How do I set names.x

I want to know how to set x names in a option variable.

var names = {};

and then set
names.{username from event (e.user.username)} = 1;


You can use bracket notation to pass variable as key.

var username = 'Lorem';
var names = {};

names[username] = 1;