Join Eve Porcello for an in-depth discussion in this video Enhancing object literals, part of Up and Running with ECMAScript 6.
- ES6 enhancements give us ways of shortening…and simplifying object literals.…Let's take a look at an example of an ES5 object.…On line six, I'm going to create a variable called cat.…And our cat object is going to contain several methods.…The first of these methods is meow.…The second of these methods is purr.…And the third of these methods is snore.…
Great, so now that I've done this,…I want to use a console.log message…to have our function log a quick message for us.…Now we're going to use Array.join…and then we need to pass in some parameters here…to our array constructor…and our join method.…So what I'm going to pass in here to array is times.…Array is going to construct the array,…and the number that I pass in as a parameter…will be the number of positions in that array.…
So here we're going to use times…and we're also going to pass in times to the function.…Now join is going to take the elements of the array…and join them together as a string.…So the value that I pass into the join method…will be the character or the word…
- What is ECMAScript?
- Transpiling ECMAScript with Babel and Babel-node
- Using the let and const keywords
- Creating strings with template strings
- Enhancing object literals
- Working with ES6 classes and class inheritance
Skill Level Beginner
Learn React.js: The Basics (2015)with Eve Porcello1h 32m Beginner
Up and Running with AngularJS 1with Ray Villalobos1h 20m Intermediate
Building a Polling App with Socket IO and React.jswith Alex Banks3h 56m Intermediate
1. What Is ECMAScript 6 (ES6)?
2. Transpiling ES6
3. ES6 Syntax
4. ES6 Functions & Objects
5. ES6 Classes
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.