Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
How do i make a number in An array increase by 1

I have this question :

An Array nums is given. Per one operation you remove one number with a value of K or under K from the array. After each removal K is increased by one.

So I have this as answer

function getNumber(nums,k){
  k = nums.slice(1);
  let j = k++;
  a = nums.push(j)
  return a;
}

let arr = [1,2,3,4];
let k = 1;
console.log(getNumber(arr,k));

It does not work as expected , its supposed to remove the first number or any number in the array and add 1 , how can I do this ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!