Code
Questions
Resources
Lists
Courses
Level-Up Today with Advanced Frontend Courses by Industry Veterans
Information

How to implement Array.prototype.reverse? JavaScript Interview Question | Problem Solving | JavaScript Polyfills

Submission by @Aaquib Ahmed
14
More Questions
What would be the output? [New Operator | Explicit Non Primitive Return]
How would you implement Promise.race from scratch? | Promise Polyfills | JavaScript Interview Questions
Implement Star Rating Widget | Frontend Coding Challenge | DevKode Challenge
How to implement custom map function with limit on number of operations? | Paytm Frontend Interview Question | JavaScript Interview Questions | Frontend Problem Solving
How to implement Array.prototype.find? JavaScript Interview Question | Problem Solving | JavaScript Polyfills
More Resources
What Every React Developer Should Know! | Part 1 | Stale Closures
How to Improve Your Codebase!? | Custom ESLint Rules | Advanced JavaScript | Devtools Tech
Understanding Arrow Functions in JavaScript
Beyond Code | Episode 1 | Video Podcast
Create Your Own Redux | Part 2 | CreateStore API | Advanced Frontend
/**
 * Read FAQs section on the left for more information on how to use the editor
**/
/**
 * DO NOT CHANGE FUNCTION NAME
 */

function customReverse() {
  // DO NOT REMOVE
  'use strict';
  
  function swap(a,b){
    let temp = a
    a = b
    b = temp
  }

  // write your code below
  let i = 0
  let j = this.length
  
  while(i < j){
    swap(this[i], this[j])
    i++
    j--
  }
  return this
}

Array.prototype.customReverse = customReverse;

Read-only

Quick Links

  • Interview Questions
  • Interview Resources
  • Frontend Interview Series
  • Frontend Interview Preparation Course
  • JavaScript Fundamental Series
  • React Performance Series
  • Devtools Tech YouTube Channel
  • Top Submissions
  • Programming Videos
  • Terms and Conditions
  • Support Devtools Tech
  • Contact Us
  • Sitemap

Popular Resources

  • JavaScript Questions Lists
  • JavaScript Array Polyfills Questions
  • Advanced JavaScript Interview Questions
  • Top JavaScript MCQs
  • DevKode Frontend Coding Challenges
  • Build Your Own Redux Series
  • JavaScript Interview Questions
  • React.js Interview Questions
  • JavaScript Promises Series
  • React Stale Closures

Stay up to date

Subscribe to our newsletter to stay up to date with all the latest content. No spam ever!
Devtools Tech Logo

All rights reserved Devtools Digital Services 2022

Made with in India