diff --git a/9. ES6/README.md b/9. ES6/README.md index c8c5523..145a587 100644 --- a/9. ES6/README.md +++ b/9. ES6/README.md @@ -648,19 +648,6 @@ console.log(a); // 3 console.log(b); // 5 ``` -Use this for default options arguments: - -```JavaScript -function drawES2015Chart({size = 'big', cords = {x: 0, y: 0}, radius = 25} = {}) { - console.log(size, cords, radius); -} - -drawES2015Chart({ - cords: {x: 18, y: 30}, - radius: 30 -}); -``` - You can pull values from a function argument that's an object: ```JavaScript @@ -680,6 +667,19 @@ function userId({id}) { console.log('userId: ' + userId(user)); // "userId: 42" ``` +Use this for default options arguments: + +```JavaScript +function drawES2015Chart({size = 'big', cords = {x: 0, y: 0}, radius = 25} = {}) { + console.log(size, cords, radius); +} + +drawES2015Chart({ + cords: {x: 18, y: 30}, + radius: 30 +}); +``` + If you have a property name which is not a valid variable name, you can reassign it: ```JavaScript