Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Basic_Concepts/Promise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@

A Promise represents an operation that hasn't completed yet, but is expected in the future.

# Course Documentation

(this for me to fill up with every element

that you use in lessons. syntax

explaination and links for more)
# Course Documentation

## HTML

Expand Down
73 changes: 60 additions & 13 deletions Basic_Concepts/Prototype/README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,73 @@
![](http://i.imgur.com/BgUMUGU.png)

# Prototype

This MD file serves as example/template.
# Prototype

It will be filled up soon.
According to [W3schools](http://www.w3schools.com/js/js_object_prototypes.asp):
Every JavaScript object has a prototype. The prototype is also an object.
All JavaScript objects inherit their properties and methods from their prototype.

(for Bucky to fill up)


# Course Documentation


## Javascript prototypes

According to [W3schools](http://www.w3schools.com/js/js_object_prototypes.asp):
**Every JavaScript object has a prototype. The prototype is also an object.**

Person.prototype.getName = function () {
return this.firstName + " " + this.lastName;
};

All JavaScript objects inherit the properties and methods from their prototype.
Objects created using an object literal, or with new Object(), inherit from a prototype called Object.prototype.
Objects created with new Date() inherit the Date.prototype.
The Object.prototype is on the top of the prototype chain.
All JavaScript objects (Date, Array, RegExp, Function, ....) inherit from the Object.prototype.

Person.prototype.getName = function () {
return this.firstName + " " + this.lastName;
};

var bucky = new Person('Bucky', 'Roberts');
var emily = new Person('Emily', 'Jones');

console.log(bucky.getName());
console.log(emily.getName());

## Objects

In our example for objects we used the following code:


Person.prototype.getName = function () {
return this.firstName + " " + this.lastName;
};

var bucky = new Person('Bucky', 'Roberts');
var emily = new Person('Emily', 'Jones');


That is the typical syntax of javascripts object as well:

var objectname = {
property1: "property1valueinstringformat",
property2: property2valueinarithmeticformat
};

We achieve to insert more values in one variable by turning it to an object and by use the "property" format to each of our value


(this for me to fill up with every element
{ property: valueofproperty };

that you use in lessons. syntax
Curley brackets are defining the are of the properties, and also they defining that our variable is an object, and we separate our properties with the comma symbol.

explaination and links for more)
- Read more about [Object Oriented
Programming](https://en.wikipedia.org/wiki/Object-oriented_programming)
- in Wikipedia Read more about [Javascript
Objects](http://www.w3schools.com/js/js_objects.asp) in W3schools

## Element to explain

(for example console.log)

***Links***
- Wikipedia
- Anotherlink,com
> Written with [StackEdit](https://stackedit.io/).