sudhakarinfotech
(current)
Run Code
Live Code Editor- Javascript Create Associative Array Object
Source Code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Creating Javascript Associative Array</title> </head> <body> <h1>Creating Javascript Associative Array</h1> <script type="text/javascript"> var x = {}; x.name = "John Doe"; x.age = 20; x.job = "Developer"; document.writeln("Name:" + x["name"] + " age: " + x["age"] + " job: " + x["job"]); </script> </body> </html>
Source Code Output :
Running