Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

top 50 mcq que in javascript

function solve(arr, rotations){
 if(rotations == 0) return arr;
 for(let i = 0; i < rotations; i++){
   let element = arr.pop();
   arr.unshift(element);
 }
 return arr;
}
// solve([44, 1, 22, 111], 5);
Source by www.interviewbit.com #
 
PREVIOUS NEXT
Tagged: #top #mcq #javascript
ADD COMMENT
Topic
Name
1+3 =