Aerodynamika
Aerodynamika

Reputation: 8413

How to avoid escape characters added to a variable in Javascript?

Hello I have the following variable:

var delete_query = []

Then I assign

delete_query[0] = "CALL apoc.index.relationships('TO','statement:241') YIELD rel WITH DISTINCT rel DELETE rel;"

However, when I then print it out console.log(delete_query);

I see something like

[ 'CALL apoc.index.relationships(\'TO\',\'statement:ae976060-1649-11e8-b256-ff710bab2aaf\') YIELD rel WITH DISTINCT rel DELETE rel;']

How do I avoid escape character \ being added?

Thanks!

Upvotes: 0

Views: 330

Answers (1)

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385144

No character has been added to the string. This is just the console adding it for display, so that it is unambiguous with respect to the quoting. It's essentially showing you the string as it would have to be written in source code, if it were written in source code.

Upvotes: 1

Related Questions