This Repo required for Asac labs class 2
A script is a series of instructions that a computer can follow one-by-one.
statement is each individual instruction or step of the script, Statements should end with a semicolon.
the curly braces that Some statements are surrounded by. The closing curlybrace is not followed by a semicolon.
A script will have to temporarily store the bits of information it needs to do its job. It can store this data in variables. in a variable can change (or vary) each time a script runs. structure:
variable-key variable-name;
assign a value to the variable:r
variable-name = variable-value;
NUMERIC DATA TYPE
variable-name = variable-value;
The name must begin with a letter,($),or(_).It must not start with a number.
you must not use (-) or (.) in a variable name.
All variables are case sensitive.
Use a name that describes the kind of information that the variable stores.
You cannot use keywords or reserved words.
If your variable name is made up of more than one word, use a capital letter for the first letter of every word after the first word.
An array is a special type of variable. It doesn’t just store one value; it stores a list of values. you can use it on a list or a set of values that are related to each other.
var Array-Name = [value1,value2…valueN]
var Array-Name = new Array(value1 , value2,valueN);
The array literal is preferred over the array constructor when creating arrays.
Values in an array are accessed as if they are in a numbered list. It is important to know that the numbering of this list starts at zero (not one).
Update the an item in the array: colors[the-item’s-index-number] = NewValue ;
An expression evaluates into (results in) a single value.
var variable-name = variable-value;
var variable-name = value1 (* - + % / ) value2
Expressions rely on things called operators; they allow programmers to create a single value from one or more values.
ARITHMETIC OPERATORS
\
two operators are used in string operators:
Using a flowchart will help making decisions
EVALUATION OF A CONDITION: An expression is evaluated, which returns a value
CONDITIONAL STATEMENTS: A conditional statement says what to do in a given situation
### USING COMPARISON OPERATORS:
var var1 = value1;
var var2 = vakue2;
var Comparison-variable = var1 (>,<,>=,<=,==,===,!=,!==) var2;
Logical operators are used to determine the logic between variables or values.
-> Logical or |
The if statement evaluates (or checks) a condition. If the condition evaluates to true, any statements in the subsequent code block are executed.
The if…else statement checks a condition. If it resolves to true the first code block is executed. If the condiion resolves to false the second code block is run instead.
……………………………………………………………………………………………………………………………………………………………………. |
<h1> <h2> <h3> <h4> <h5> <h6>
H1 is the biggest and h6 is the smallest.
the diffrence between headings is the level of important
<p>the paragraph you want</p>
bold:<b>
<b>This is bold text</b>
The Result: This is bold text
Italic:<i>
<i>This is Italic text</i>
The Result: This is Italic text
Superscript: <sup>
value<sup>th</sup>
The Result: valueth
Subscript: <sub>
value<sub>th</sub>
The Result: valueth
white space collapsing: When the browser comes across two or more spaces next to each other, it only displays one space.
<p>Some text</p>
The Result: <p>Some text</p>
Some<br>text
The Result:
Some
text
some <hr>text
The Result:
some <hr>text
Semantic Markup: elements that are not intended to affect the structure of your web pages, but they do add extra information to the pages — they are known as semantic markup. i.e. <em><blockquote>
<strong>strong text</strong>
The Result: strong text
The <em> element indicates emphasis that subtly changes the meaning of a sentence. By default browsers will show the contents of an <em> element in italic.
text <em>Emphasis</em> text
The Result: text Emphasis text
<blockquote>:
The <blockquote> element is used for longer quotes that take up an entire paragraph. Browsers tend to indent the contents of the <blockquote>
<blockquote> element is used for longer quotes that take up an entire paragraph. Browsers tend to indent the contents of the </blockquote>
The Result:
element is used for longer quotes that take up an entire paragraph. Browsers tend to indent the contents of the
<q>:
The <q> element is used for shorter quotes
<q>This element is used for shorter quotes </p>
The Result:
This element is used for
shorter quotes </p>
<abbr title=”Professor”>Prof</abbr>
The Result:
Prof
When you are referencing a piece of work such as a book, film or research paper, the text will be italic
<cite>a work name</cite> by auther
The Result: a work name by auther
The <dfn> element is used to indicate the defining instance of a new term.the text will be italic
A <dfn>black hole</dfn>
The Result: A black hole
<address> <a href=”mailto:homer@example.org”> \homer@example.org</a>
<p>742 Evergreen Terrace, Springfield.</p> </address>
The Result:
homer@example.org742 Evergreen Terrace, Springfield.
It was the <del>worst</del> <ins>best</ins> idea <s>Was $995</s>
The Result:
It was the worst best idea Was $995
Text
CSS allows you to create rules that control the way that each individual element (and the contents of that element) is presented.
indicate which element the rule applies to.
indicate how the elements referred to in the selector should be styled.
INTRODUCING CSS