return

ip

});

function

main

()

const

example

new

Example

();

example

_getIPAddress

()

then

ip

=>

console

log

ip

))

catch

error

=>

console

error

error

));

main

();

For more information, see the documentation on
Future objects.

async and await

The async function declaration defines an asynchronous function.

In JavaScript, the async function returns a Promise.
The await operator is used to wait for a Promise.