Improve and fix examples for padBytesRight

feature-extract-files
toby 2017-02-09 13:37:30 -05:00
parent 0eef1d972a
commit 0fd2550190
1 changed files with 8 additions and 2 deletions

View File

@ -104,11 +104,17 @@ var Utils = {
* @returns {byteArray}
*
* @example
* // returns "['a', 0, 0, 0]"
* // returns ["a", 0, 0, 0]
* Utils.padBytesRight("a", 4);
*
* // returns "['a', 1, 1, 1]"
* // returns ["a", 1, 1, 1]
* Utils.padBytesRight("a", 4, 1);
*
* // returns ["t", "e", "s", "t", 0, 0, 0, 0]
* Utils.padBytesRight("test", 8);
*
* // returns ["t", "e", "s", "t", 1, 1, 1, 1]
* Utils.padBytesRight("test", 8, 1);
*/
padBytesRight: function(arr, numBytes, padByte) {
padByte = padByte || 0;