/**
* OOP: ch.1
* =====================================================
* Encapsulation -
* Data can be grouped together with functionality
* that operates on that data.
*
* Aggregation -
* One object can reference another object.
*
* Inheritance -
* A newly created object has the
* same characteristics as another object
* without explicitly duplicating its functionality.
*
* Polymorphism -
* One interface may be implemented by multiple objects.
* It is the practice of designing objects to share
* behaviors and to be able to override shared
* behaviors with specific ones.
*
*/
/**
* Primitive types are stored as simple data types.
*
* Reference types are stored as objects,
* which are really just references to locations in memory.
*
* The tricky thing is that JavaScript lets you treat
* primitive types like reference types in order to
* make the language more consistent for the developer.
*
*/
/*
* PRIMITIVE Types:
* =====================================================
* Boolean -
* true or false;
*
* Number -
* Any integer or floating-point numeric value;
*
* String -
* A character or sequence of characters delimited
* by either single or double quotes;
* (JavaScript has no separate character type)
*
* Null -
* A primitive type that has only one value, null;
*
* Undefined -
* A primitive type has only one value,
* undefined (undefined is the value
* assigned to a variable that is not initialized);
*
*
* When you assign a primitive value to a
* variable, the value is copied into that variable.
* This means that if you set one variable equal to
* another, each variable gets its own copy of the data.
*
*/
//native string
var daughter1 = "Makayla";
//gets copy of daughter1
var daughter2 = daughter1;
console.log('*** daughter2 COPY of daughter 1 ***');
console.log('daughter1 => ', daughter1);
console.log('daughter2 => ', daughter2);
//value update won't...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.