In order of importance.
If you use a variable in JavaScript code - it must be set previously - e.g. add to log or something (crazy I know).
let enteredNumGB = $(n152.collect.input).toString();
i.e. the variable $(n152.collect.input) must be logged to log file or something! Why???