Features Of ES6 Part 6: Destructuring

Posted by: K. Scott Allen, on 11 Sep 2014 | View original | Bookmarked: 0 time(s)

To destructure an object is to dismantle or tear apart an object. In ES6, a destructuring assignment allows us to tear apart an array or object into individual pieces that we can assign to variables. The square brackets [ and ] are used to destructure an array, while { and } will destructure an object. The following code will destructure an array so that x contains 22 and y contains 44. let values = [22, 44]; let [x, y] = values; expect(x).toBe(22); expect(y).toBe(44); You can think of [ and...

Category: Ajax | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1442 | Hits: 14

Similar Posts

  • Introducing SharePoint 2010 Training at U2U more
  • Visual Studio 2010 Extension Manager more
  • GiveCamps Get a new Sponsor more
  • Scenarios for WS-Passive and OpenID more
  • More On The CodePlex Foundation more
  • ASP.NET MVC V2 Preview 1 Released more
  • Why Embedded Silverlight Makes Sense more
  • Dynamic Languages: A Separation of Concerns more
  • ESRI Silverlight/WPF API: Release Candidate available more
  • .NET RIA Services roadmap update more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD