Last active
January 16, 2024 16:58
-
-
Save amrelarabi/eff21c425072a4050bdadf2fa045041d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var text = '{ "employees" : [' + | |
'{ "firstName":"John" , "lastName":"Doe" },' + | |
'{ "firstName":"Anna" , "lastName":"Smith" },' + | |
'{ "firstName":"Peter" , "lastName":"Jones" } ]}'; | |
var obj = JSON.parse(text); | |
// وفى صفحة الويب | |
<p id="demo"></p> | |
<script> | |
document.getElementById("demo").innerHTML = | |
obj.employees[1].firstName + " " + obj.employees[1].lastName; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment