Write a function that takes three parameters n1, n2 and n3 where the number n1 is the starting number of the array, n2 is the number of array elements, n3 is the number of arrays. The function returns a two-dimensional array, in which the first array starts with n1 and contains n2 elements, and each subsequent array starts with n1 + 1.

Help please write on pure js

Closed due to the fact that off-topic participants smellyshovel , Igor , Air , aleksandr barakin , Jarvis_J 8 Nov '18 at 17:04 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • " Learning tasks are allowed as questions only on the condition that you tried to solve them yourself before asking a question . Please edit the question and indicate what caused you difficulties in solving the problem. For example, give the code you wrote, trying to solve the problem "- smellyshovel, Igor, Air, aleksandr barakin, Jarvis_J
If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    function getArray(n1, n2, n3) { var a = []; var start = n1; for (var i = 1; i <= n3; i++) { var j; var innerA = []; for (j = start; j < start + n2; j++) { innerA.push(j); } start = ++n1; a.push(innerA); } return a; } 
    • subsequent arrays are created as a continuation of that array. they should start with n1 + 1 - RedLionHeart
    • must be assigned to the variable start = ++ n1. Fixed - JavaJunior