Array accedere ai membri




'Gli oggetti usano i nomi per accedere ai suoi "membri". In questo esempio, person.firstName restituisce John: 33


'Oggetto:

'var person = {firstName:"John", lastName:"Doe", age:46};


https://www.w3schools.com/js/tryit.asp?filename=tryjs_array_object

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript Objects</h2>
<p>JavaScript uses names to access object properties.</p>
<p id="demo"></p>

<script>
var person = {firstName:"John", lastName:"Doe", age:46};
document.getElementById("demo").innerHTML = person["firstName"];
</script>

</body>
</html>













( arrayaccedereaimembri.html )- by Paolo Puglisi - Modifica del 17/12/2023