Question about primitive data type and reference data type data

14 views
Skip to first unread message

Enrique Tecayehuatl

unread,
Apr 8, 2017, 7:00:06 PM4/8/17
to Zakas Books
I have seen some definitions about the reference data types which means they are pointing to a location in memory, but I am in doubt because I know the primitive data are stored in memory (but not to point to anything), the only difference is that primitive data are not pointing to a location in memory (but they use memory space), so is it possible to say we are using a memory space but not pointing to it in primitive data type? 


Thanks for answering 

Nicholas Zakas

unread,
Apr 8, 2017, 10:22:54 PM4/8/17
to Zakas Books
I'm assuming this question is in relation to the Principles of Object-Oriented Javascript book? (I've written a bunch, so it helps to know which you are referencing.)

Every variable has a memory space and a value stored in that memory space. Primitive values store the actual value in their memory space while reference values store a pointer to some other location in memory (in other languages, that location is in the heap, in JS it's just some separate location).
On Sat, Apr 8, 2017 at 4:00 PM Enrique Tecayehuatl <kink...@gmail.com> wrote:
I have seen some definitions about the reference data types which means they are pointing to a location in memory, but I am in doubt because I know the primitive data are stored in memory (but not to point to anything), the only difference is that primitive data are not pointing to a location in memory (but they use memory space), so is it possible to say we are using a memory space but not pointing to it in primitive data type? 


Thanks for answering 

--
You received this message because you are subscribed to the Google Groups "Zakas Books" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zakasbooks+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Enrique Tecayehuatl

unread,
Apr 9, 2017, 12:57:15 AM4/9/17
to Zakas Books
Yeah, I was talking about to that book, sorry for not including the name, I didn't know you has written a bunch of book, thank you for clarify my doubt, I will be asking a lot here :)
Reply all
Reply to author
Forward
0 new messages