8. ES8 #
Created Friday 17 July 2020
Important changes in 2017:
- String functions for adding spaces to the end(s).
myString.padStart(targetLength, fillUnit)
myString.padStart(20, '*')
Output:******8273
myString.padEnd(20, 'x');
Output:Angry Birdsxxxxxxxxx
- Trailing comma is ignored - in iterables, objects, functions(call and definition). But avoided repeated commas in arrays, otherwise empty elements will be created.
- Object iteration key, value or both:
Object.keys(student)
- existing feature.Object.values(student)
- returns an array of values.Object.entries(student)
- returns an array of key value pairs(as arrays of size 2). Note:Object
class is used here.
- Async Await - FIXME
Note:
"my String".trim()
trims the whitespace at the ends.