Change the provided string from double to single quotes and remove the escaping

Change the provided string from double to single quotes and remove the escaping
0

#1

Good evening, have anyone recently figured
out how to solve this problem, where i this URL

var myStr = "<a href=\"http://www.example.com\" target=\"_blank\">Link</a>";

you are ask to
"Change the provided string from double to single quotes and remove the escaping."?


#2

What have you tried?


#3

I’ve edited your post for readability. When you enter a code block into the forum, remember to precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


#4

To solve the problem you’ll need to change the outer "s to 's and remove the backslashes.

SPOILER ALERT (Code Solution Enclosed - Click To View):

var myStr = '<a href="http://www.example.com" target="_blank">Link</a>';