FazBrowse Wikipedia Viewer | Main Page |
Search Wikipedia:
|
Viewing: https://kab.wikipedia.org/wiki/JavaScript

JavaScript

Contents
    Tawri n Node.js: JavaScript yeffeɣ seg Yiminig (2009)
    Tagrawla n ES6 / ES2015 d Ukatar n yimahilen (Frameworks)
    Tallit Tatrart: TypeScript, WebAssembly d Tigzi Taragmawant (2018-Ass-a)
    2.2. Alugen ECMAScript
    2.3. Imeslayen n usihel yeqqnen ar JavaScript
3. Taseddast d Umawal
    3.1. Tawsit n tmeslayt
    3.2. Tiseddast tigejdanin
        3.2.1. Imuttiyen
5. Tiseɣnin
    5.1. Tasɣent talugant
6. Taɣawsa d Usihel s Tɣawsa
    6.1. Asenteḍ n tɣawsa
    6.4. Akwbal
8. Asihel Aramtawan
    8.1. Callbacks
    8.2. Promise (Lweɛd)
    8.3. Async/Await

JavaScript
langage de script , langage de programmation fonctionnel , langage interprété , langage de haut niveau , programmation fonctionnelle d programmation événementielle d programmation web
Yeska ɣefECMAScript Ecma International
Identifiant de version logicielle text/javascript, application/x-ecmascript, application/x-javascript, text/javascript1.0, text/javascript1.1, text/javascript1.2, text/javascript1.4, text/javascript1.3, text/javascript1.5, text/livescript, text/x-ecmascript d text/x-javascript
Système de typage d Programmation orientée prototype js d mjs

JavaScript d tutlayt n usihel mebla aefsu(Tameslayt tasuɣlant) i d-yesnulfa Brendan Eich (Netscape). JavaScript itddu kan deg yiminig web maca tura nezmer ad t-nesseqdec deg tama n uqeddac(Backend) s Node.js.

Tameslayt n usihel JavaScript tella d yiwet seg tmeslayin yettwasxedmen aṭas deg umaḍal n tsenselkimt. Seg wasmi i d-tlul deg useggas n 1995, teqqel d taɣawsa tagejdant deg usnerni n Web. Ass-a, ur tettwaḥseb ara kan d tameslayt n yisebtar n Web, wanag tettwasxedem daɣen deg usihel n yiqeddacen, n yisnasen izirazen, d kran n yisnasen n tnarit, d waṭas n yiḥricen-nniḍen.

Tallit n "Web 2.0" d Ajax (2000-2008)ẓregẓreg aɣbalu

Deg tazwara n yiseggasen n 2000, JavaScript ur yettwaqadar ara aṭas, yella kan i usihel n yimussuyen (Amray/Merru) d yisebtar fessusen. Maca, tallit n Web 2.0 tbeddel kulci.

Asnas n Ajax (Asynchronous JavaScript and XML) yefka i yimsihlen tizemmar ad selḥun isefka seg uqeddac war ma alsen asali n usebter. Isnasen am Gmail (2004) d Google Maps (2005) sbegnen-d d akken JavaScript yezmer ad isali isnasen n Web ixanzen d isdawanen.

Deg tallit-a, tlul jQuery (2006), d tamkarḍit i yessifsen asihel n DOM yerna tefru uguren n umgaru gar yiminigen.

2009 (ES5): Ecma tefka lqem ES5, i d-yernan JSON s wudem unṣib, Array.prototype.map/filter, d uskar strict mode i uḍman n tɣellist n tengalt.

Tawri n Node.js: JavaScript yeffeɣ seg Yiminig (2009)

ẓregẓreg aɣbalu

Aseggas n 2009 yella d tagrawla deg umezruy n JavaScript. Amsihel Ryan Dahl yesnulfa Node.js, s useqdec n umutur V8 n Google Chrome.

Aya yefka i JavaScript tizemmar ad ixeddem deg tama uqeddac (backend), mačči kan deg yiminig (frontend). Seg imir-nni, JavaScript tuɣal d tameslayt "Full-Stack", anda amsihel yezmer ad iseqdec yiwet n tutlayt i yisebtar n Web, i yiqeddacen, d yizdaren(affiwin)n n yisefka.

Tagrawla n ES6 / ES2015 d Ukatar n yimahilen (Frameworks)

ẓregẓreg aɣbalu

Deg useggas n 2015, Ecma tefka lqem ameqqran akk deg umezruy n tmeslayt-a: ECMAScript 2015 (ES6). Seg wass-a, alugen yuɣal yettbeddel yal aseggas (ES2016, ES2017, ...).

ES6 yerna tiseddast tatrarin i yerran asihel yeshel yerna iqud:

let d const i usefrek n telqeyt (scope).

Tiseɣnin s uaneccab (Arrow functions =>).

Tiserkemt i usihel yuɣden ar tɣawsa.

Lweɛd (Promises) i usefrek n usihel aramtawan (asynchrone).

Izegrar kter/sifeḍ.

Deg tallit-a daɣen, akatar n yimahilen (frameworks) am React (Facebook, 2013), Angular (Google), d Vue.js beddelen amek i ttwasalnen yisnasen n Web, s useqdec n yimudam am "Virtual DOM" d "Composants".

Tallit Tatrart: TypeScript, WebAssembly d Tigzi Taragmawant (2018-Ass-a)

ẓregẓreg aɣbalu

Ma d ass-a, JavaScript ur yesɛi ara tilas. Amhaz-is yekcem deg waṭas n yiḥricen:

TypeScript: Tameslayt i d-tesnulfa Microsoft i yernan tawsit n isefka (typage statique) i JavaScript. Ass-a, tuget n yisnasen imeqqranen ttwagen s TypeScript i uḍman n tɣellist d tmellet n tengalt.

WebAssembly (Wasm): Yefka tizemmar i yimsihlen ad selkmen tangalt (C++, Rust) deg yiminig s urured iqerben ar iseɣẓanen n tnarit yettwarun s C/C++ (natif), yettwasqdec s umata i yisnasen izuyaz (am uraren) d usihel aẓayan.

Tigzi Taragmawant : S tmkarḍiyin am TensorFlow.js, JavaScript yuɣal yezmer ad iselkem timudmiwin n tigzi taragmawant srid deg yiminig, war ma yuzen isefka ar uqeddac, d ayen ara yemmestnen tudert tusligt.

Isnasen Izirazen d Tnarit: S React Native d Electron, JavaScript ass-a yessalay isnasen i tilifunat (iOS/Android) d yiselkimen n tnarit (am VS Code akked Discord).

2.2. Alugen ECMAScript

ẓregẓreg aɣbalu

Deg useggas n 1997, JavaScript tuɣal d alugen n Ecma International s yisem "ECMAScript". Seg imir-nni, tameslayt-a tettwasnerni s waṭas n ileqman:

2.3. Imeslayen n usihel yeqqnen ar JavaScript

ẓregẓreg aɣbalu

Aṭas n tmeslayin-nniḍen n usihel bnant ɣef JavaScript neɣ ttwasuqlent ar JavaScript:

TypeScript: Tameslayt n usihel s tewsit n isefka (typed) i d-yesnulfa Microsoft.

CoffeeScript: Tameslayt yettwasuqlen ar JavaScript s tseddast ifessusen.

Dart: Tameslayt n usihel i d-yesnulfa Google, tettwasxedem deg Flutter.

3. Taseddast d Umawal

ẓregẓreg aɣbalu

3.1. Tawsit n tmeslayt

ẓregẓreg aɣbalu

JavaScript d tameslayt:

Tasuɣlant: Ur teḥwaǧ ara asefsu send aselkem. Amessuɣal iqqar-d tangalt srid.

S tawsit asmussaw: Tawsit n umutti tettubeddel deg wakud n uselkem.

Agetkalmaḍ (multi-paradigme): Tesseddu asihel s tɣawsa, asihel amesɣan, d usihel s tedyanin.

3.2. Tiseddast tigejdanin

ẓregẓreg aɣbalu

3.2.1. Imuttiyen

ẓregẓreg aɣbalu

JavaScript yesɛa kraḍ n wawalen i usenteḍ n yimuttiyen:

typeof42;// "number" typeof"Azul";// "string" typeoftrue;// "boolean" typeofundefined;// "undefined" typeofnull;// "object" (tuccḍa deg umezruy) typeof{};// "object" typeof[];// "object" typeoffunction(){};// "function"

5. Tiseɣnin

ẓregẓreg aɣbalu

5.1. Tasɣent talugant

ẓregẓreg aɣbalu
consttiseɣnin=[ x=>x*2, x=>x+1 ];

6. Taɣawsa d Usihel s Tɣawsa

ẓregẓreg aɣbalu

6.1. Asenteḍ n tɣawsa

ẓregẓreg aɣbalu
classAnelmadextendsAmdan{ constructor(isem,leɛmer,asɣar){ super(isem,leɛmer); this.asɣar=asɣar; } azur(){ return`Azul, nekk d ${this.isem}, anelmad deg ${this.asɣar}`; } }

6.4. Akwbal

ẓregẓreg aɣbalu

Seg ES2022, JavaScript yesɛa iɣewwaṛen usligen s #:

// Tineddict for for(leti=0;i<10;i++){ console.log(i); } // Tineddict while letj=0; while(j<5){ console.log(j); j++; } // Tineddict for...of (i tefelwin) for(constazalof[1,2,3]){ console.log(azal); } // Tineddict for...in (i tɣawsiwin) for(consttsaruttin{isem:"Samir"}){ console.log(tsarutt); }

8. Asihel Aramtawan

ẓregẓreg aɣbalu

8.1. Callbacks

ẓregẓreg aɣbalu

Aɣewwaṛ amezwaru n usihel aramtawan:

{\n callback({isem: \"Samir\"});\n }, 1000);\n}\n"}}'>functionawiIsefka(callback){ setTimeout(()=>{ callback({isem:"Samir"}); },1000); }

8.2. Promise (Lweɛd)

ẓregẓreg aɣbalu
{\n setTimeout(() => {\n resolve({isem: \"Samir\"});\n }, 1000);\n });\n}\n\nawiIsefka()\n .then(isefka => console.log(isefka))\n .catch(tuccḍa => console.error(tuccḍa));\n"}}'>functionawiIsefka(){ returnnewPromise((resolve,reject)=>{ setTimeout(()=>{ resolve({isem:"Samir"}); },1000); }); } awiIsefka() .then(isefka=>console.log(isefka)) .catch(tuccḍa=>console.error(tuccḍa));

8.3. Async/Await

ẓregẓreg aɣbalu

Tarrayt tatrart i usihel aramtawan:


View original on Wikipedia | Back | FazBrowse Home