首页 > 解决方案 > 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
})

标签: javascript

解决方案


推荐阅读