Javascript is a high-level object-oriented multi-paradigm programming language
what do we actually use for
HTML
CSS
Javascript hide paragraph
Interactive effects allow Dynamic effects and web applications in the browser
React Angular Vajue Based on javascript Front-end
Node js Back-end applications
Objects and primitives
VALUE
OBJECT
let me ={
name:'Jonas'
};
Or PRIMITIVE
let firstName = 'Jonas';
let age = 30;
There are 7 primitive data types
1 NUMBER floating point numbers used for decimals and integers let age = 23;
2 STRING sequence of characters used for text let firstName = 'Jonas';
3 BOOLEAN Logical type that can only be true or false used for taking decisions let fullAge = true;
4 UNDEFINED: Value has taken by a variable that is not yet defined ('empty value) let children;
5 NULL also means an empty value
6 symbol (ES2015) Value
Three forms to call variables in js
Let: could change in the future
Const: can't change in the future
ALWAYS USE CONST
var job = ' programmer';
job = 'teacher';
Var can change in the future
OPERATORS
There are many types of operators
Template literals
const valeryNew = `I'm ${firstName}, ${ birthYear}`;
Strings
`${const}`
console.log(`just a regular string ...`);
String multiple lines
console.log(`string
multiple
lines`);
Taking decisions
if (){
} else {
}if else{
}
Decision Booleans
&& AND
CONDITIONALS OPERATORS
An operator always produces a value
ternary operators
JAVASCRIPT RELEASES: ES5, ES6+ AND ESNEXT
A brief history of Javascript
1995 creates the very first version of js in just 10 days
1996 Changed to LiveScript and then to JavaScript, in order to attract Java developers, Js is very different from java.
Microsoft launches IE copying Javascript from Netscape and called it Jscrit
In 1997 with a need to standardize the language ECMA releases ECMAScript 1 the first official standard for Javascript (ECMAScript is the standard, Javascript is the language in practice);
2009 ES5 (ECMAScript 5) is released with lots of great new features;
2015 ES6/ES2015 (ECMAScript 2015) was released: THE BIGGEST UPDATE TO THE LANGUAGE EVER.
ECMAScript changes to an annual release cycle in order to ship fewer features per update
BACKWARDS COMPATIBILITY: Don't break the web
1997 compatible 2020
Old features are never removed
Not really new versions just incremental updates
websites keep working forever
HOW TO USE MODERN JAVASCRIPT TODAY
During development: Simply use the latest Chrome
During production: Use babel to transpile and polyfill your code converting back to ES5 to ensure the browser is compatible with all users).
ES5 Fully supported in all browsers( down to IE 9 from 2011)
Ready to be used today
ES6/ES2015 ES6+ well supported in all modern browsers
ES2020 No support in older browsers
Can use most features in production with transpiring and poly filling.
MODERN JAVASCRIPT FROM THE BEGINNING
Learn modern Javascript from the beginning
Functions Js
Can hold one or more code lines
Function calling a function
Comments
Post a Comment