๐พarr.padEndSpaces()
JS โฉ objects โฉ Array โฉ methods โฉ padEndSpaces()
ไธป่ฆ็จๆผๆบๅ Google Sheet ่กจๆ ผ็ๅ่ณๆ (row)ใ
๐พ replit: arr.padEndSpaces()
// ๐ธ 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)ใ
Last updated
Was this helpful?