Javascript One-pass solution
The idea in each spiral both row and col movements will have the same offset. but may have different limits (or boundaries). \nSo compute cLimit for column and 
The idea in each spiral both row and col movements will have the same offset. but may have different limits (or boundaries). \nSo compute `cLimit` for column and  `rLimit`  for row and update the offset to the next spiral length whenever both `i`  add `j` are equal to their respective limits\n\n```\nvar spiralMatrixIII = function(R, C, r0, c0) {\n    let offset = 1, cLimit = c0+offset, rLimit = r0+offset\n    let i = r0, j = c0\n    let res = []\n    \n    while(res.length < R*C){\n\t\t//if i and j are within the boundaries of the matix and to res\n        if(i>=0 && j>=0 && i<R && j<C){  \n            res.push([i,j])\n        }\n        // if i and j are both equal to their respective limits upate offset to next spiral length and direction\n        if(i == rLimit && cLimit == j){ \n            offset = offset<0 ? offset-1 : offset+1\n            offset *= -1\n            cLimit = cLimit + offset\n            rLimit = rLimit + offset\n        }\n        // each of the four possible movements through the matrix\n        if(j<cLimit) j++\n        else if(i<rLimit) i++\n        else if(j>cLimit) j--\n        else if(i>rLimit) i--\n    }\n    return res\n};\n```
['JavaScript']