JavaScript escape quotes in strings
Original link: https://www.sey.ink/5458/ Defining a string must enclose it in single or double quotes. So what do you do when your string contains quotes ” or ‘ ? In JavaScript, quotes can be escaped by preceding them with a backslash ( \ ). const sampleStr = “Alan said, \”Peter is learning JavaScript\”.”; With the escape […]
JavaScript escape quotes in strings Read More »