how to change const values in array using JS

how to change const values in array using JS


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>how to change const values in array using JS</title>



</head>
<body>
<script>

const a = [10,20,30];
a[1]=25;
a[2]=35;
// const a = [15,25,35]; this doesn't work
console.log(a);
document.write(a);

</script>
</body>
</html>


Comments

Popular posts from this blog