I'm programming a web-app on electron and need the app to do some stuff based on use input:
basically, on a user input, my code saves var string = "stuff"
then on another input it saves var string = "other_stuff
is it possible to
#1 - detect how many times the user has inputted to get a var and save it using something like var string_1 = "stuff" and var string_2 = "other_stuff" etc
#2 - when these buttons are pressed, create code within a loop (that will be ran on a buttonpress) that looks something along the lines of this
try{
function('string_1');
}
catch (error)
console.log(error);
try{
function('string_2');
}
catch (error)
console.log(error);
On button press use array.push(str); to add to the end of an array.
Then use
function txt_download(str) {
// code stuff
}
for (const element of array) {
txt_download(element)
}
To run the functions