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.

+ Repo –
+ Atom editor –
+ Download GIT –
+ Vue docs –

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


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

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

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

For more front-end development tutorials & to black-belt your coding skills, head over to – or

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

Twitter – @TheNetNinja –


  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?


Please enter your comment!
Please enter your name here