Is there any way to change the data.js file in local machine with user input?

I have data.js file and addPet.js file.

data.js file has objects in dataObject which is the list of the animals.

addPet.js file accepts user input from index.html.

In this case if I put infos in form input and submit it, then the data.js file has that input infos as last object in dataObject in data.js file?

The end goal is rendering the dataObject in the website(which exist as script.js)

const dataObject = {
  1: {
    name: "Fido",
    type: "dog",
    nature: "playful",
    status: "available",
  },
  2: {
    name: "Benson",
    type: "cat",
    nature: "jittery",
    status: "homed",
  },
  3: {
    name: "Esio",
    type: "tortoise",
    nature: "excitable",
    status: "available",
  },
  4: {
    name: "Turbo",
    type: "tortoise",
    nature: "relaxed",
    status: "available",
  },
  5: {
    name: "Ron Possible",
    type: "hamster",
    nature: "playful",
    status: "available",
  },
};