SHARE

Hey gang, in this tutorial I’ll show you the difference between reference and primitive types in JavaScript. Not technically Vue – related, but important when working with Vue.js no-the-less.

—– COURSE LINKS:
+ Repo – https://github.com/iamshaunjp/vuejs-playlist
+ Atom editor – https://atom.io/a
+ Download GIT – https://git-scm.com/
+ Vue docs – https://vuejs.org/v2/guide/

———————————————————————————————
You can find more front-end development tutorials on CSS, HTML, JavaScript, jQuery, WordPress, Node.js & more on the channel homepage…

SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1

========== PSD to WordPress Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9gnow7e45LQFkNVxwQ5BH-W

============ Node.js for Beginners Playlist =============

https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp

============== The Net Ninja =====================

For more front-end development tutorials & to black-belt your coding skills, head over to – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk

================== Social Links ==================

Twitter – @TheNetNinja – https://twitter.com/thenetninjauk

12 COMMENTS

  1. Is it normal to keep the styles in the same file like you show? Or is this just for the videos to make it easier for us to see. i really like having everything for each component in the same file.

  2. in the header you added the title prop, but didn't delete the title variable defined in data. So does this mean that props always override data? Or is that only true because you defined props before data? When doing the on click event, is it changing the prop or data's title?

  3. I found a work around..

    you can pass the "referenced" object to a variable ….using JSON.stringify and JSON.parse.. i was able to make a copy of it…. working so far..didn't play around too much

  4. I have a similar question to Joshua. I've done a bit of stuff in React and they're all about one-way, but editing a reference type in a child component seems to violate that pattern…. In practical terms when building apps to people use ref types this way from child components?

  5. How do we avoid this when dealing with reference types? Are we going to apply immutability rules like duplicating the array and storing it into another variable?
    Btw, good tutorials bro! Keep it up! Subscriber since the early days of your channel!

  6. Hey I can't find the difference when defining primitives and reference types.
    How can I define when prop is primitive and when is reference?

LEAVE A REPLY

Please enter your comment!
Please enter your name here