Geriausios „JavaScript“ mokymo programos

„JavaScript“ yra plačiausiai naudojama scenarijų kalba Žemėje. Ir ji turi didžiausią bibliotekos ekosistemą iš visų programavimo kalbų.

„JavaScript“ yra pagrindinė žiniatinklio kalba ir vienintelė programavimo kalba, kuria galima naudotis visose pagrindinėse žiniatinklio naršyklėse.

Pažymėtina, kad „JavaScript“ nėra susijęs su „Java“. Peržiūrėkite „JavaScript“: labiausiai nesuprastą programavimo kalbą pasaulyje.

Oficialus „JavaScript“ pavadinimas yra ECMAScript, apibrėžtas standarte ECMA-262.

Jei norite sužinoti daugiau apie „JavaScript“ kalbą ir kodėl ji taip plačiai naudojama, perskaitykite Quincy Larson straipsnį - Kokią programavimo kalbą turėčiau išmokti pirmiausia? - arba žiūrėkite šį įkvepiantį Preethi Kasireddy vaizdo įrašą.

„freeCodeCamp“ turi išsamią „JavaScript“ pamoką „YouTube“, kuri išmokys visus pagrindus vos per 3 valandas.

Keletas kitų gerų „JavaScript“ vadovėlių:

  • „JavaScript“ katėms
  • Šiuolaikinė „JavaScript“ mokymo programa
  • Profesoriaus Frisby dažniausiai adekvatus funkcinio programavimo vadovas
  • Iškalbingas „Javascript“ ( anotuotas )
  • Kalbėjimas „Javascript“
  • Naršyti ES6
  • „Udemy“ - „Javascript“ keistų dalių supratimas ( pirmieji 3,5 val. )
  • Funkcinis programavimas „JavaScript“
  • „JavaScript“ įvadas: pirmieji žingsniai
  • Douglaso Crockfordo vaizdo įrašai
  • Šiuolaikinis „JS Cheatsheet“
  • 50 geriausių svetainių, mokančių „JavaScript“
  • „Codementor“ „JavaScript“ pamoka
  • Jums gali nereikėti „jQuery“

Nuorodos

  • „DevDocs“
  • „OverAPI JavaScript“ apgaulės lapas
  • ECMA-262
  • „Mozilla“ kūrėjų tinklas (MDN)

Greitas „JavaScript“

  • REPL ( mazgas )
  • JSBin
  • JSFiddle
  • „CodePen“
  • „CoderPad“ ( porinis programavimas )
  • C9 ( IDE , porinis programavimas )
  • Objektų žaidimų aikštelė ( vizualizuokite objektus )
  • Plunkeris

Iššūkiai

  • Kodo karai
  • Piratų reitingas
  • Kodavimo žaidimas
  • „CodeFights“
  • ES6 Katas

Pamokos

  • Bendra knyga
  • „RithmSchool“

Pratimai

  • Kodiškumas
  • Coderbyte
  • Mankšta
  • „JavaScript “30
  • Javascript.com (pluralsight)

Redaktoriai

  • „Visual Studio“ kodas
  • Atomas
  • Ištaigingas tekstas
  • „Webstorm“
  • Skliausteliuose

Tinklaraščiai

  • Tobulumas žudo
  • 2alumas
  • JS kolekcija „Medium“
  • Davidas Walshas
  • superherojusJS

Tinklalaidės

  • JS Jabber

Vaizdo įrašų pamokos

  • Dereko Banano „Sužinok JS viename vaizdo įraše“
  • Dereko Banano „Objective Orient JavaScript“

Knygos

  • „JavaScript Ninja“ paslaptys
  • „JavaScript“ programų programavimas
  • Palaikoma „JavaScript“
  • Mokymasis „JavaScript“ dizaino modelių
  • „Airbnb“ „JavaScript“ stiliaus vadovas
  • JSDoc
  • „Javascript Allonge Six“
  • Jūs nežinote JS

6 knygos apie „JavaScript“, autorius Kyle Simpson, nuo pradedančiųjų iki pažengusių.

  • Iškalbingas „Javascript“

Fantastic, thorough introduction to the basics and features of JavaScript, complete with in-browser interactive code.

  • Professor Frisby’s Mostly Adequate Guide to Functional Programming

Quite in-depth guide to Functional Programming in JavaScript

  • The JavaScript Way
  • Functional Light JS

Standalone JavaScript engines

Mozilla’s SpiderMonkey, the first JavaScript engine ever written, currently used in Mozilla Firefox.

V8, Google’s JavaScript engine, used in Google Chrome.

Google Apps Script, a cloud-based/server-side interpreter that provides programmatic “macro-like” control of Google Apps services and documents.

Node.js, built on top of V8, a platform which enables server-side applications to be written in JavaScript.

Windows includes JScript, a JavaScript variant in Windows Script Host.

Chakra, a fork of Jscript, is developed by Microsoft and used in their Edge browser.

Mozilla also offers Rhino, an implementation of JavaScript built in Java, typically embedded into Java applications to provide scripting to end users.

WebKit (except for the Chromium project) implements the JavaScriptCore engine.

JavaScript Frameworks

The most frequently used JavaScript Frameworks are React JS, Angular JS, jQuery, and NodeJS. For more details follow this link.

Advantages and Disadvantages of JavaScript

Like with all programming languages, JavaScript has certain advantages and disadvantages to consider. Many of these are related to the way JavaScript is often executed directly in a client's browser. But there are other ways to use JavaScript now that allow it to have the same benefits of server-side languages.

Advantages of JavaScript

  • Speed - JavaScript tends to be very fast because it is often run immediately within the client's browser. So long as it doesn't require outside resources, JavaScript isn't slowed down by calls to a backend server. Also, major browsers all support JIT (just in time) compilation for JavaScript, meaning that there's no need to compile the code before running it.
  • Simplicity - JavaScript's syntax was inspired by Java's and is relatively easy to learn compared to other popular languages like C++.
  • Popularity - JavaScript is everywhere on the web, and with the advent of Node.js, is increasingly used on the backend. There are countless resources to learn JavaScript. Both StackOverflow and GitHub show an increasing amount of projects that use JavaScript, and the traction it's gained in recent years is only expected to increase.
  • Interoperability - Unlike PHP or other scripting languages, JavaScript can be inserted into any web page. JavaScript can be used in many different kinds of applications because of support in other languages like Pearl and PHP.
  • Server Load - JavaScript is client-side, so it reduces the demand on servers overall, and simple applications may not need a server at all.
  • Rich interfaces - JavaScript can be used to create features like drag and drop and components such as sliders, all of which greatly enhance the user interface and experience of a site.
  • Extended Functionality - Developers can extend the functionality of web pages by writing snippets of JavaScript for third party add-ons like Greasemonkey.
  • Versatility - There are many ways to use JavaScript through Node.js servers. If you were to bootstrap Node.js with Express, use a document database like MongoDB, and use JavaScript on the frontend for clients, it is possible to develop an entire JavaScript app from front to back using only JavaScript.
  • Updates - Since the advent of ECMAScript 5 (the scripting specification that JavaScript relies on), ECMA International has been dedicated to updating JavaScript annually. So far, we have received browser support for ES6 in 2017 and look forward to ES7 being supported in the future.

Disadvantages of JavaScript

  • Client-Side Security - Since JavaScript code is executed on the client-side, bugs and oversights can sometimes be exploited for malicious purposes. Because of this, some people choose to disable JavaScript entirely.
  • Browser Support - While server-side scripts always produce the same output, different browsers sometimes interpret JavaScript code differently. These days the differences are minimal, and you shouldn't have to worry about it as long as you test your script in all major browsers.

ES6

The 6th edition of ECMAScript is called ES6.

It is also know as ES2015.

The changes add a lot of syntactic sugar that allow developers to create applications in an object oriented style.

ES5 example:

var User = function () { function User(name) { this._name = name; } User.prototype.getName = function getName(x) { return 'Mr./Mrs. ' + this._name; }; return User; }();

ES6 example:

class User { constructor(name) { this._name = name } getName() { return `Mr./Mrs. ${this._name}` } }

A lot of new syntax features were introduced including:

  • classes
  • modules
  • templating
  • for/of loops
  • generator expressions
  • arrow functions
  • collections
  • promises

Nowadays most of the features are available in all popular browsers. The compatibility table contains all information about feature availability of all modern browsers.

Frequently, new features arrive that are part of the successor ES7. A common way is to translate modern JavaScript (ES6, ES7 and other experimental proposals) to ES5. This makes sure that also old browsers can execute the code. There are tools like Babel that transforms new JavaScript to ES5.

Besides syntactic sugar coming from ECMAScript standards there are features that require a Polyfill. Usually they are necessary because whole class/method implementations were added to the standard.

Object Instantiation

In JavaScript and most other languages, an object contains a series of properties, which are a key, value pair. There are multiple options available to you when you need to construct an object.

Initialize an object variable

You can create an object with pre-defined properties like so:

let myObject = { name: "Dave", age: 33 }

Creating an empty object

Tai sukuria tuščią objektą „myObject“ kintamojo viduje:

let myObject = new Object();

Jei norite prie objekto pridėti ypatybių, tiesiog naudokite taškų žymėjimą arba skliausteliuose esančią žymėjimą su pasirinktu ypatybės pavadinimu:

myObject.name = "Johnny Mnemonic" myObject["age"] = 55

Naudojant konstruktoriaus funkciją

Galite apibrėžti konstruktoriaus funkciją, kurią galite naudoti kurdami savo objektus:

function Kitten(name, cute, color) { this.name = name, this.cute = cute, this.color = color }

Apibrėždami kintamąjį, kuriame yra šio objekto pavyzdys, galite paskambinti konstruktoriaus funkcija:

let myKitten = new Kitten("Nibbles", true, "white")

Object.create ()

Metodas Object.create () (pirmą kartą apibrėžtas ECMAScript 5.1) leidžia kurti objektus. tai leidžia jums pasirinkti objekto prototipą naujam objektui nereikalaujant iš anksto apibrėžti konstruktoriaus funkcijos.

// Our pre-defined object let kitten = { name: "Fluff", cute: true, color: "gray" } // Create a new object using Object.create(). kitten is used as the prototype let newKitten = Object.create(kitten) console.log(newKitten.name) // Will output "Fluff"