Серго
-
Posts
1 -
Joined
-
Last visited
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy
Возврат объекта
in JavaScript
Posted
let c
const newPost = (post, addedAt = Date()) => c = {
...post,
addedAt,
}
const firstPost = {
id: 1,
author: 'Serg',
}
console.log(newPost(firstPost))
Если не сложно, можешь объяснить почему у меня всё работает, хотя я не использовал return и является ли правильной такая запись кода?