How to use foreach loop with the array and objects in knockout js magento?

knockout Javascript with Foreach loops for the observable array and objects with the data-bind property of the DOM tag.

Let’s start with a simple for each loop with an array that contains the numbers only,

JS file contains the knockout declaration of the observable array, called getNumbers property, Continue reading “How to use foreach loop with the array and objects in knockout js magento?”

How to fixed Uncaught SyntaxError: Unexpected token } in JSON at position Magento?

Magento page console error Uncaught SyntaxError: Unexpected token } in JSON at position 530 while you have made mistake to your code.

Code with Error in a template file: Continue reading “How to fixed Uncaught SyntaxError: Unexpected token } in JSON at position Magento?”

How to resolved Uncaught SyntaxError: Unexpected token ‘ in JSON at position 159 in Magento?

While Developing features with Magento and javascript, sometimes you are facing an error in the browser console for the unexpected token defined in JSON and that will break your Magento functionality on that page.

This type of error we are facing is due to tiny mistakes in javascript JSON Declaration in our code.

This error is coming because our javascript snippet declaration using script text x-magento-init syntax has minor mistakes. Continue reading “How to resolved Uncaught SyntaxError: Unexpected token ‘ in JSON at position 159 in Magento?”