JavaScript JSON.parse is not working for converting JSON string to JSON object json.parse not working,json.parse not working in javascript,

Your JSON string is multiline. Multiline string should be stored using template literals, otherwise use string concatenation to represent your string.

The below exmaple uses template literals. It is used to represent multi line string.

var str = `{
	"condition": "AND",
	"rules": [{
			"id": "amount",
			"operator": "greater_or_equal",
			"value": "900"
		},
		{
			"condition": "AND",
			"rules": [{
					"id": "vendorname",
					"operator": "equal",
					"value": "US BANK NATIONAL ASSOCIATION"
				},

				{
					"id": "vendorname",
					"operator": "equal",
					"value": "HANSEN SOLUTIONS  LLC"
				}
			]
		}
	]
}`;

console.log(JSON.parse(str));
Answer:1

I draw many circles with some loops via d3.js var line = d3.svg.line() var r = 1 var svg = d3.select("body").append("svg:svg") .attr("width", 1000) .attr("height",1000) for ( var x=0; x<...

I draw many circles with some loops via d3.js var line = d3.svg.line() var r = 1 var svg = d3.select("body").append("svg:svg") .attr("width", 1000) .attr("height",1000) for ( var x=0; x<...

  1. lenovo smart display update loop

this is my html code : <div> <label for="accompanying_person" class="col-sm-4 col-form-label">Select number of accompanying person</label> <div class="col-sm-8"&...

this is my html code : <div> <label for="accompanying_person" class="col-sm-4 col-form-label">Select number of accompanying person</label> <div class="col-sm-8"&...

I want user mouse position while the user is holding down the mouse button continuously? I try to do the with following code: $(div).mousedown(function(eventObj){ console.log(eventObj.clientX); ...

I want user mouse position while the user is holding down the mouse button continuously? I try to do the with following code: $(div).mousedown(function(eventObj){ console.log(eventObj.clientX); ...

I am using Selenium WebDriver and coding in Java. In a code I need to scroll down to a specific element in the web page for clicking it. I am using JavascriptExecutor command. My question is how will ...

I am using Selenium WebDriver and coding in Java. In a code I need to scroll down to a specific element in the web page for clicking it. I am using JavascriptExecutor command. My question is how will ...