Skip to content

Instantly share code, notes, and snippets.

@raynerpupo
Created April 30, 2019 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raynerpupo/47acda72556f0f9124b11d2bd0d03c57 to your computer and use it in GitHub Desktop.
Save raynerpupo/47acda72556f0f9124b11d2bd0d03c57 to your computer and use it in GitHub Desktop.

Modern JavaScript

Template literals

Multiline strings

Default parameters

Classes

class Book {
constructor(title, author, pages) {
 this.title = title;
 this.author = author;
 this.pages = pages;
 }
 function getPageCount() {
 return this.pages;
 }
 function getAuthor() {
 return this.author;
 }
 function getTitle() {
 return this.title;
 }
}
class Novel extends Book {
 constructor(title, author, pages, genre) {
 super(title, author, pages);
 this.genre = genre;
 }
 function getGenre() {
 return this.genre;
 }
}
let book = new Novel('The Hobbit', 'J.R.R. Tolkien', 310, 'Fantasy');

Arrow functions

Improved object literals

Destructuring

Promises

Spread operator

Rest parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment