Sure, like this:
$(myObj).attr({"data-test-1": num1, "data-test-2": num2});
Like the .attr() docs state:
Setting several attributes at once
To change the alt attribute and add the title attribute at the same
time, pass both sets of names and values into the method at once using
a plain JavaScript object. Each key-value pair in the object adds or
modifies an attribute:$('#greatphoto').attr({ alt: 'Beijing Brush Seller', title: 'photo by Kelly Clark' });When setting multiple attributes,
the quotes around attribute names are optional.