Learn-Full-Stack / Javascript

0 stars 0 forks source link

Day-2 Reference Vs Value #3

Open purushothaman-source opened 1 year ago

purushothaman-source commented 1 year ago

Blog

https://blog.webdevsimplified.com/2021-03/js-reference-vs-value/

Videos

purushothaman-source commented 1 year ago

Screenshot from 2022-11-10 08-32-15

Screenshot from 2022-11-10 08-33-56

Screenshot from 2022-11-10 08-34-36

purushothaman-source commented 1 year ago

Examples

const a = [1, 2]

function addElement(array, element) {
  array.push(element)
}

addElement(a, 3)
console.log(a)
// [1, 2, 3]