loading...

Convert to JSON in Python vs Javascript

victoromondi1997 profile image VICTOR OMONDI ・1 min read

Python:

import json

user = {
    "name": "Victor"
}

json_py = json.dumps(user)

Javascript:

const user = {
    name: "Victor"
}

const jsonJs = JSON.stringify(user);

Discussion

pic
Editor guide