[80% OFF Udemy Coupon]. Learn Modern JavaScript Essentials Quickly and save $40 today! with "Quick Course: JavaScript Essentials in 1 Hour (2018). Only $9.99!!
https://www.udemy.com/quick-course-javascript-essentials-in-1-hour-2018/?couponCode=HEM313A
2. JAVASCRIPT OVERVIEW
JavaScript is not Java.
JavaScript is a programming language for the web.
provide dynamic interactivity on websites.
Add new HTML Elements and CSS Selectors to the Web pages.
User interface enhancements such as menus and dialog boxes, animations, graphics, ……and
many more.
It Works on The Client Side and The Server Side.
4. IMPORTANT
Is Case Sensitive
( firstMessage != firstmessage )
( while not While or WHILE )
camelCase
( camelCaseMethod )
Semicolon ; Required: statements are on the same line. Example: let i = 1; i++ ;
Optional: After statements . Example: let i = 7; & let myName = “Ahmed”;
Rejected: after Curly Brackets . Example: if () { } & else { } & for () { } & while () { } & function
(arg) { }
18. FUNCTIONS
function addition(x, y) {
let result = x + y;
return result;
}
console.log(addition(2,3)); // 5
console.log(addition(7,1)); // 8
19. CLOSURES
A closure is a function having access to the parent scope, even after the parent function has closed.
function newFunc() {
let name = “Ahmed”;
function display() {
console.log(name);
}
return display;
}
var myFunc = newFunc();
myFunc();
20. DOM (DOCUMENT OBJECT MODEL)
o DOM Methods
document.getElementById()
document.getElementsByTagName()
document.getElementsByClassName()
document.querySelectorAll()
document.querySelector()
addEventListener()
setAttribute()
getAttribute()
21. DOM (DOCUMENT OBJECT MODEL)
o EVENTS
onmousemown occurs when a user presses a mouse button over an element.
onclick occurs when the user clicks on an element
onblur occurs when an object loses focus.
onmouseover occurs when the pointer is moved onto an element
onmouseout occurs when a user moves the mouse pointer out of an element
onmousemove occurs when the pointer is moving while it is over an element.
onfocus occurs when an element gets focus
onload occurs when an object has loaded
22. REGULAR EXPRESSIONS
o FORMAT
let RegEx = /patterns/modifiers;
let reg1 = new RegExp("abc");
let reg2 = /abc/;
o CHARACTERS
^ Start of string.
$ End of string.
a* Zero or more of a.
a+ One or more of a.
a{2} Exactly 2 of a.
a{2,} 2 or more of a.
a{2,5} Between 2 and 5 of a.
23. REGULAR EXPRESSIONS
d Any digit character.
w An alphanumeric character (“word character”).
s Any whitespace character (space, tab, newline, and similar).
D A character that is not a digit.
W A nonalphanumeric character.
t Matches a horizontal tab.
S A nonwhitespace character.
0 Matches a NUL character.
. Any character except for newline.
24. REGULAR EXPRESSIONS
o RegEx MODIFIERS
/g Global matching
/i Case insensitive
/u Unicode; treat pattern as a sequence of Unicode code points
/s Single line mode
/m Multi line mode