genId.js 183 Bytes BlameHistoryPermalink Edit 1 2 3 4 5 6 7 8 export const genId = array => { const { length } = array let lastIndex = 0 if (length) lastIndex = Number(array[length - 1]?.id) + 1 return lastIndex || (length + 1) }