reading-notes

What is the hardest thing about writing code?

Understanding The Problem Domain Is The Hardest Part Of Programming.

There are many ways to make it easier such as, learning a new technology, naming things and testing your code

A familiar problem

When someone starting to learn something new they should not start big and learn all the material in a single day or do an advanced things also, the best way to learn is start samll and then improve and one of the ways to to start good is to start with a simple code or an easy one so that anyone can understand it without any difficulties to make coding or the structure of the language easy enough and can be learnd.

What is an object?

Objects group together a set of variables and functions to create a model of a something you would recognize from the real world. In an object, variables and functions take on new names.

IN AN OBJECT: VARIABLES BECOME KNOWN AS PROPERTIES If a variable is part of an object, it is called a property. Properties te ll us about the object.

IN AN OBJECT: FUNCTIONS BECOME KNOWN AS METHODS If a function is part of an object, it is called a method. Methods represent tasks that are associated with the object.

Object Literal.

A JavaScript object literal is a comma-separated list of name-value pairs wrapped in curly braces. Object literals encapsulate data, enclosing it in a tidy package. This minimizes the use of global variables which can cause problems when combining code.

The following demonstrates an example object literal:

let myObject = {

sProp: 'some string value',

numProp: 2,

bProp: false

}

Object literal property values can be of any data type, including array literals, functions, and nested object literals.

Object Literal Syntax

Object literals are defined using the following syntax rules:

A colon separates property name from value. A comma separates each name-value pair from the next. A comma after the last name-value pair is optional.

Document Object Model

The Document Object Model (DOM) specifies how browsers should create a model of an HTML page and how JavaScript can access and update the contents of a web page while it is in the browser window. And it is language-independent.

The HTML DOM Tree of Objects