czwartek, 18 lipca 2019

Programming exercise #8 - dealing with objects

Imagine, that you have array of objects like this:

const array = [
{ name: "something", value: "something" },
{ name: "somethingElse", value: "something else" },
{ drinkName: "vodka", value: "Pshenicnaja" }
];

I want to ask you, about transform this array into one object, that looks like this:

const res = { name: 'somethingElse',
  value: 'Pshenicnaja',
  drinkName: 'vodka' }

As you can see, we do not want get duplicated keys in result.

poniedzia艂ek, 15 lipca 2019

Programming exercise #7 - promises basics

Very simple exercise - please create a promise, that returns some text after 2 seconds. When there was an error, console.error message.
Also do the same, using async and await syntax.