reading-notes-201d25


Project maintained by Mahmoud-Khader Hosted on GitHub Pages — Theme by mattgraham

READ07

The < table >

element is used to create a table. The contents of the table are written out row by row

You can create spanning cells across rows and columns (and both) using two attributes defined for the < td > and < th > tags. As you might expect, the colspan attribute creates a cell that spans two or more columns

For long tables you can split the table into a < thead > , < tbody > and < tfoot >

Objects:

The new keyword and object constructor creat a blank object You can then add a properties and methods to the object To update the value of properties use dot notation or square brackets they work on objects created using literal or constructor notation. to delete a property use the delete keyword

to use the method, you can use the object name followed by the method name

CREATING AN OBJECT WITH PROPERTIES & METHODS

This :

A function’s this keyword behaves a little differently in JavaScript compared to other languages. It also has some differences between strict mode and non-strict mode In most cases, the value of this is determined by how a function is called (runtime binding). It can’t be set by assignment during execution, and it may be different each time the function is called. ES5 introduced the bind() method to set the value of a function’s this regardless of how it’s called, and ES2015 introduced arrow functions which don’t provide their own this binding (it retains the this value of the enclosing lexical context).

RECAP: STORING DATA In JavaScript, data is represented using name/value pairs. To organize your data, you can use an array or object to group a set of related values. In arrays and objects the name is also known as a key.

VARIABLES A variable has just one key (the variable name) and one value.

ARRAYS

Arrays can store multiple pieces of information. Each piece of information is separated by a comma. The order of the values is important because items in an array are assigned a number (called an index)

WHAT IS AN OBJECT MODEL?

is a group of objects, each of which represent related things from the real world. Together they form a model of something larger The topmost object in the Document Object Model (or DOM) is the document object In JavaScript there are six data types: Five of them are described as simple (or primitive) data types. The sixth is the object (and is referred to as a complex data type)

SIMPLE OR PRIMITIVE DATA TYPES

  1. String
  2. Number
  3. Boolean
  4. Undefined
  5. Null

COMPLEX DATA TYPE:

  1. 0bject

JavaScript also has several built-in objects such as String, Number, Math, and Date. Their properties and methods offer functionality that help you write scripts. Arrays and objects can be used to create complex data sets (and both can contain the other)