You're trying to index an object, but not trying to access varLine1_X variables. As it's commented in the question, if these variables are global, there's no problem to get/index the global object with "varLine1_" + X:
window['varLine1_' + i]
If you want to do this using local variables, you'd need to use eval
that parses/executes an code in the same scope where it has been called (this is also commented on the question).
eval('varLine1_' + i)
However it happens that these tricks make the code hard to work and understand. Try using objects / arrays (as commented, also):
var linesGroups = [
[ 50 ]
];
// Confirm that the first element/prop "0" of linesGroups array
// is indexable
if (linesGroups[0])
// Iterate each item of linesGroups[0]
// if it's iteratable
for (var item of linesGroups[0]) {
if (item === lineOpt1_1) {
cp.hide(Examples_Button_1_1);
}
};