Day 5 of #100DaysOfCode!

Today’s progress?

Did some more exercises on constructors from freeCodeCamp.

What I learned

Constructors are functions that create new objects and they define properties and behaviors that belong to the new object.

They are to be defined with a ca…


This content originally appeared on DEV Community and was authored by Christian Falucho

Today's progress?

Did some more exercises on constructors from freeCodeCamp.

What I learned

Constructors are functions that create new objects and they define properties and behaviors that belong to the new object.

They are to be defined with a capitalized name to distinguish them from other functions that are not constructors.

Here is an example of the Car constructor capitalized.

function Car(){
}

Constructors use the keyword this to define properties of the object they will create. Referring to the new object they will create.

function Car(){
   this.color = "black";
   this.make = "Lexus";
   this.model = "IS 250";
}


This content originally appeared on DEV Community and was authored by Christian Falucho


Print Share Comment Cite Upload Translate Updates
APA

Christian Falucho | Sciencx (2021-06-20T21:55:13+00:00) Day 5 of #100DaysOfCode!. Retrieved from https://www.scien.cx/2021/06/20/day-5-of-100daysofcode/

MLA
" » Day 5 of #100DaysOfCode!." Christian Falucho | Sciencx - Sunday June 20, 2021, https://www.scien.cx/2021/06/20/day-5-of-100daysofcode/
HARVARD
Christian Falucho | Sciencx Sunday June 20, 2021 » Day 5 of #100DaysOfCode!., viewed ,<https://www.scien.cx/2021/06/20/day-5-of-100daysofcode/>
VANCOUVER
Christian Falucho | Sciencx - » Day 5 of #100DaysOfCode!. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/20/day-5-of-100daysofcode/
CHICAGO
" » Day 5 of #100DaysOfCode!." Christian Falucho | Sciencx - Accessed . https://www.scien.cx/2021/06/20/day-5-of-100daysofcode/
IEEE
" » Day 5 of #100DaysOfCode!." Christian Falucho | Sciencx [Online]. Available: https://www.scien.cx/2021/06/20/day-5-of-100daysofcode/. [Accessed: ]
rf:citation
» Day 5 of #100DaysOfCode! | Christian Falucho | Sciencx | https://www.scien.cx/2021/06/20/day-5-of-100daysofcode/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.