0
let legValue = parseInt(legLenght.value);
        let currHeight = e.value;
        let numHeight = parseInt(currHeight.substring(0,3));
        let optionsFound;

        if(legValue ==64){
            optionsFound=[43, 44, 45];
        } 

I have the code above, when i execute it under catalog -> content-> CMS block, i get this weird bug when i look at it in developers tool in chrome

enter image description here

the brackets seem to disappear in the code... how may i fix this

  • optionsFound string or array? if you are using string, put double quotes optionsFound="[43,44,45]", if its array, optionsFound = ["42","43"] – Vishnunath Jun 18 '18 at 10:17
  • its an array which contains number – Compu Scie Jun 18 '18 at 10:18
0

Try to define code like this

let optionsFound = [];

if(legValue == 64){
   optionsFound.push(43,44,45);
}
  • 1
    also i made let optionsFound= new Array(); using [ ] doesnt work..... but with combibnig two now it works thanks ........ – Compu Scie Jun 18 '18 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.