В
Size: a a a
В
DS
j
return this
в конце каждой функции.ei
DS
DK
return this
в конце каждой функции.DK
return this
в конце каждой функции.p
p
ЛХ
j
['multiply', 'divide', 'plus', 'minus']
. В массив собираются данные вида 'команда', 'число'. [ 2, 'plus', 2, 'multiply', 2 ]
. Всё обходишь в цикле согласно порядку.j
for (const command of this._order) {
for (let i = 1; i < this._data.length; i += 2) {
if (this._data[i] === command) {
this._data[i - 1] = this.evaluate(this._data[i - 1], this._data[i], this._data[i + 1])
this._data.splice(i, 2)
i -= 2
}
}
}
return this._data[0]
DK
['multiply', 'divide', 'plus', 'minus']
. В массив собираются данные вида 'команда', 'число'. [ 2, 'plus', 2, 'multiply', 2 ]
. Всё обходишь в цикле согласно порядку.L
ФФ
J
export const loginUser = (user) => async dispatch => {
await axios
.post('/login', user)
.then(response => {
localStorage.setItem('usertoken', JSON.stringify(response.data));
dispatch(setCurrentUser(JSON.stringify(response.data)))
})
};
если хочу передать объект, просто response.data, dispatch(setCurrentUser((response.data)))то вы дает ошибку
DK
J