mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-07 11:08:54 +08:00
docs: fix typo in rotateRight's docstring (#1527)
This commit is contained in:
@ -59,14 +59,14 @@ function chunkify(str, size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rotates string representation of bits to th left
|
* Rotates string representation of bits to the right
|
||||||
*
|
*
|
||||||
* @param {string} bits - string representation of bits
|
* @param {string} bits - string representation of bits
|
||||||
* @param {int} turns - number of rotations to make
|
* @param {int} turns - number of rotations to make
|
||||||
* @return {string} - string representation of bits after rotation
|
* @return {string} - string representation of bits after rotation
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
* rotateLeft("1011", 3); // "1101"
|
* rotateRight("1011", 3); // "1101"
|
||||||
*/
|
*/
|
||||||
function rotateRight(bits, turns) {
|
function rotateRight(bits, turns) {
|
||||||
return bits.substr(bits.length - turns) + bits.substr(0, bits.length - turns)
|
return bits.substr(bits.length - turns) + bits.substr(0, bits.length - turns)
|
||||||
|
Reference in New Issue
Block a user