Last updated 2 years ago
Was this helpful?
⟩ ⟩ ⟩ ⟩ padEndSpaces()
主要用於準備 Google Sheet 表格的列資料 (row)。
replit:
// 🔸 arr.padEndSpaces(n) /** * pad spaces ("") to the end of array * * @example * * const a = ['班級','座號','姓名']; * a.padEndSpaces(3), // [ '班級', '座號', '姓名', '', '', '' ] * */ Array.prototype.padEndSpaces = function(n) { return this.concat(Array(n).fill('')); };
💈範例:
const a = ['班級','座號','姓名']; a.padEndSpaces(3), // [ '班級', '座號', '姓名', '', '', '' ]
國中成績一覽表 - 用於準備表格的列資料 (row)。