Skip to content

mparke/matrix

Repository files navigation

   _    _       _    _____   ____    _  __   __
  / \  / \     / \  |_   _| | _  |  | | \ \_/ /
 /   \/   \   / _ \   | |   | __ \  | |  | _ | 
/__/\__/\__\ /_/ \_\  |_|   |_| \_\ |_| /_/ \_\

a JavaScript 2 dimensional array module Build Status

Instantiation

   
     // Matrix(rowSize, data)
     // create a 2 x 2 matrix
     var matrix = new Matrix(2, [1, 2, 3, 4]);
     
     // internal representation
     [
       [ 1, 2 ],
       [ 3, 4 ]
     ]
   

API

  • size()
  • getAt(rowIndex, colIndex)
  • push(val)
  • pop()
  • reset() //optional param [] to reset with new data
  • find(function(val){ return true; })
  • each(function(val){})

About

a JavaScript 2 dimensional array module

Resources

License

Stars

Watchers

Forks

Packages

No packages published