How to Remove Double Quotes from JSON Object in JavaScript?

Nov 16, 2022 . Admin



Hello friends,

This tutorial is focused on how to remove double quotes from JSON object in javascript. I’m going to show you about removing double quotes from an object in javascript. This tutorial will give you a simple example of removing double quotes from a JSON object. you'll learn how to remove double quotes from JSON object.

To remove the double quotes from JSON object you can use replace(). We have to see how to remove double quotes from JSON object.

So, let's see bellow solution:

Example:
index.html
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>How to Remove Double Quotes from JSON Object in JavaScript?</title>
</head>
<body>
<script type="text/javascript">

    //create jsonColor
    var jsonColor = "\"Black\"";

    //print remove double quotes from an object
    console.log(jsonColor.replace(/\"/g, ""));  
</script>
</body>
</html>
Check The Console For Output:
Black

I hope it will help you...

#Javascript