DEV Community

Cover image for Whoa there Bubba!!!!
KingCodingByDee2020
KingCodingByDee2020

Posted on

Whoa there Bubba!!!!

Davoris Cowell

About Me

Hi! I'm from Georgia. I've been coding for four years now but there's never too much knowledge!

Dublin, GA 31021.

Weeks 2 & 3

Functions & Object Oriented Programming

What we learned these past two weeks have been challenging, but yet very productive. We've been going over objects, arrays, and functions.

Functions are one of the fundamental building blocks in JavaScript. A function in JavaScript is similar to a procedure—a set of statements that performs a task or calculates a value, but for a procedure to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output. To use a function, you must define it somewhere in the scope from which you wish to call it. Functions can be declared or expressed. The difference between the two id when and where they are invoked. We've also discussed how a function can be called in another function, which is called closures. Closures are the nesting of functions, and grants the inner function full access to all the variables and functions defined inside the outer function.

Object Oriented Programming or OOP is based on the concept of "objects", which can contain data and code: attributes or properties, and code, in the form of methods. Objects can contain related data and code, which represent information about the thing you are trying to model, and functionality or behavior that you want it to have. Object data can be encapsulated in a namespace making it easy to structure and access.

Special thanks to the MDN for helping me understand these definitions more thoroughly!!

Top comments (0)