Join the DZone community and get the full member experience.Join For Free
On May 6 and 7, 2019, the most recent Google I/O conference was held. This is an annual technology event that has been organized by Google every year since 2008. The forum brings together developers from around the world to present and discuss topics related to Google products, open Internet technologies, and new trends in the software industry.
Desktop applications with Electron.
Multiplatform mobile applications with React Native.
Iterations and Asynchronous Generator Features
Iterators can be described as pointers that sequentially run through data structure elements. These include every string, array, set, and map within these structures. The
Symbol.iterator key can be used to iterate through these features. The
nextdefined method is also useful. This feature can return the properties listed below:
Value: This variable returns the value for the very next element in a given sequence called with the
Done: This Boolean variable references the secession of a sequence.
An iterator or generator can be used to asynchronously read data streams. This is very similar to the syntax of the command known as
async-await, but there are a couple of important differences.
This command will wait until the URL response has been received. After this condition is satisfied, fragments of data are released and appended to the variable. A
loop-await-of continues receiving response data from the URL and the process is terminated once the stream is complete.
Finally for Your Promises
Option to Write Catch Blocks
You no longer need to pass an argument when writing a catch block.
Trimming on Various Sections of String
The trim function is most commonly used to remove white space from a string variable. However, you might not want to remove whitespace from the entire string. You can use the
trimStart functions to delineate the parts of the string that you want to trim.
Spread Command for Objects
Attributes of a Class
There are two improvements related to the attributes of a class. The first is to remove the builder function.
The constructor in the previous class is used to create an instance of the objects and assign a default value to the
_country attribute. The underscore at the beginning of the variable name is a convention for declaring private attributes of the class.
However, it is only a convention and not something that is strictly applied. This means that anyone can access the
_country property and could change the name of the destination country because the
_country attribute remains publicly accessible.
Unless you make an internal change when assigning a value to the
_country attribute, the function that assigns the value to the attribute previously retrieves the country name from the random function. In this way, the value cannot be assigned from the direct assignment to the instantiated object.
The syntax of classes is improved by removing class builder and directly initializing all top-level class attributes. The other significant improvement is making every private member truly private.
New Array Methods: flat and flatMap
flat method is used to create a new array with all the elements and/or arrays that the main array may contain.
New Object.fromEntries() method
Object.fromEntries() method transforms a list of key-value pairs into an object. It produces a result contrary to the
Object.fromEntries() method, the opposite happens. That is, it converts an object into an array.
Opinions expressed by DZone contributors are their own.