Improve example of babel-plugin-transform-es2015-arrow-functions #5573

This commit is contained in:
Sven SAULEAU 2017-04-08 10:14:19 +02:00
parent 149acc40bd
commit 2cb4d08d19
No known key found for this signature in database
GPG Key ID: 7C3212582FBA1BA2

View File

@ -27,12 +27,12 @@ console.log(bob.printFriends());
**Out**
```javascript
var a = function a() {};
var a = function a(b) {
var a = function () {};
var a = function (b) {
return b;
};
var double = [1, 2, 3].map(function (num) {
const double = [1, 2, 3].map(function (num) {
return num * 2;
});
console.log(double); // [2,4,6]
@ -40,7 +40,7 @@ console.log(double); // [2,4,6]
var bob = {
_name: "Bob",
_friends: ["Sally", "Tom"],
printFriends: function printFriends() {
printFriends() {
var _this = this;
this._friends.forEach(function (f) {