Adding data to data attribute that contains array (HTML/Javascript)

I have a html code that has a data attribute named data-keys which is an array. I want to add values to this array by javascript. What function can I use in order to do this?

<input type="text" data-keys="[]">