I read this article Multiple try-catch or one? and was wondering if there was a better way? Is there a way to just ignore the bad lines of code? My problem is I need to load multiple variables from objects that may or may not exist. Thanks everyone
toparcv = document.getElementsByName("attribute[425]")[0].value;
toparcv = document.getElementsByName("attribute[423]")[0].value;
toparcv = document.getElementsByName("attribute[424]")[0].value;
toparcv = document.getElementsByName("attribute[426]")[0].value;
toparcv = document.getElementsByName("attribute[434]")[0].value;
bottomarcv = document.getElementsByName("attribute[271]")[0].value;
bottomarcv = document.getElementsByName("attribute[265]")[0].value;
bottomarcv = document.getElementsByName("attribute[268]")[0].value;
bottomarcv = document.getElementsByName("attribute[369]")[0].value;
bottomarcv = document.getElementsByName("attribute[433]")[0].value;
console.log(toparcv);
console.log(bottomarcv);
im trying to read a textbox from a website that randomly generates the name from about 10 different names by adding 433 or 268.