Return one element array or empty array best practice in JavaScript

前端 未结 0 862
遥遥无期
遥遥无期 2020-12-22 12:38

Is there any better way to implement this?

const a = _.get(obj, \'property\');
const b = a ? [a] : [];

obj is an object, may or

相关标签:
回答
  • 消灭零回复
提交回复
热议问题