What is the result of [array A][array B]?
阿神
阿神 2017-06-26 10:51:39
0
1
760

Note that there is no operator in the middle. I saw a piece of code like this:

    this.checkerboard.forEach((value, index) => {            
        const S1Item = value[y - (x - index)];
    })

this.checkerboard is a two-dimensional array. How do you get the value saved in const S1Item?

================================================ ============================

x, y are positive integers, equal to (array.length) positive integers, and each of the x, y values ​​are the same

阿神
阿神

闭关修行中......

reply all(1)
淡淡烟草味

Because checkerboard is a two-dimensional array, so each value is an ordinary one-dimensional array. Through calculation, S1Item is the element corresponding to the subscript of this one-dimensional array.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template