let a = [1,2,3] console.info(a) //-> Array(3) [ 1, 2, 3 ] let b = [4,5,6] a.push(...b) console.info(a) //-> Array(6) [ 1, 2, 3, 4, 5, 6 ]
...arr
が何だったか忘れがちなのでメモ
牌語備忘録 -pygo
let a = [1,2,3] console.info(a) //-> Array(3) [ 1, 2, 3 ] let b = [4,5,6] a.push(...b) console.info(a) //-> Array(6) [ 1, 2, 3, 4, 5, 6 ]
...arr
が何だったか忘れがちなのでメモ
async func() { const itemsRef = db.collection('items') const querySnapshot = await itemsRef.get() console.info(querySnapshot.size)) // ドキュメントの数 const itemRef = itemsRef.doc('itemID') const doc = await itemRef.get() if (doc.exists) { itemRef.delete() return } }