Giter Club home page Giter Club logo

es6-cheatsheet's Introduction

HOW'S YOUR ES6, ES2016, AND ES2017?

Learn enough modern JavaScript to get by with this interactive cheatsheet.

This is an interactive ES6, ES2016, and ES2017 cheatsheet. It uses a series of small examples to show you the important parts of modern JavaScript. All code is editable and runnable so you can play with it all you want.

Many of my readers and workshop attendees complained that modern JavaScript looks weird at first. They could understand what I was saying, but couldn't read the code. So I built this cheatsheet to fix that.

In 5 minutes you will be able to read and understand modern JavaScript code. Using it on your own might take longer, but you can do it! :) Come back any time you're stuck.

๐Ÿ‘‰ https://es2017.io

es6-cheatsheet's People

Contributors

swizec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

es6-cheatsheet's Issues

Couple of code example booboos

Hi @Swizec, thanks a lot for yr cheatsheet, really concise and clear! I'm too broke to donate, but i did notice a couple of mistakes...

  • The last code example in the Spread Operator section has something about childObj?
// alternative to Object.assign
// 

let obj = { a: 1, b: 2 };

obj = { ...obj, 
        c: 3 
      }

console.log(obj) // {"a":1,"b":2,"c":3,"childObj":{"d":4,"e":5}}
  • Also, in yr Promises section the last code example is about async error handling, not promises reject.

All the best.

startPad() example not informative

Hi

The example given for the startPad does not print the padded version of hours.

const hours = String(new Date().getHours()),
      minutes = String(new Date().getMinutes());

hours.padStart(2, "0");
minutes.padStart(3, "0");

console.log(`${hours}:${minutes}`) // 09:05

let a = {a: '1'}

console.log({ a })

I suggest changing it to this

const hours = String(new Date().getHours()),
      minutes = String(new Date().getMinutes());

const paddedHours = hours.padStart(2, "0");
const paddedMinutes = minutes.padStart(3, "0");

console.log(`${hours}:${minutes}`) // 9:15
console.log(`${paddedHours}:${paddedMinutes}`) // 09:015

let a = {a: '1'}

console.log({ a })

Also why is there console.log({ a }) there?

Can't open a direct PR since the code is at your CodePen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.