javascript - Understanding JavaScript Objects and its properties
问题描述
I run into this piece of code while learning Redux. I am sure that the funtion returning an object and the object has type
, id
, text
properties. I know that type
equal to ADD_TODO
and id
equal to nextTodoId++
. But I have no idea about the last property. Does it mean that text: text
?
export const addTodo = text => ({
type: 'ADD_TODO',
id: nextTodoId++,
text
})
解决方案
推荐阅读
- java - 尝试捕获异常助手
- mysql - 检查与您的 MariaDB 服务器版本相对应的手册,以获取在第 1 行 sql 的 '26 ( cid int(11) not null, ' 附近使用的正确语法
- browser - 单连接浏览器
- python - 我在向我的代码添加暂停功能时遇到问题,我可以寻求帮助吗?
- react-native - 如何与烧瓶服务器(后端)通信以从反应原生前端发送信息?
- jquery - OnClick,使用 jQuery 显示带有复选框的 div
- javascript - 在 javascript 或 jquery 中向上滑动和向下滑动
- javascript - 为什么我的 iframe 没有同时加载?
- python - 尝试安装 Flask python
- javascript - 隐藏 javascript 元素 - 不是常见问题