I'm following a tutorial,although there are resources but still I'm not sure as to why we use uniformMatrix4v function.Here's the code snippet.
var matWorldMatrixLocation = gl.getUniformLocation(program,'mWorld');
var matViewMatrixLocation = gl.getUniformLocation(program,'mView');
var matProjMatrixLocation = gl.getUniformLocation(program,'mProj');
var worldMatrix = new Float32Array(16);
var viewMatrix = new Float32Array(16);
var projMatrix = new Float32Array(16);
mat4.identity(worldMatrix);
mat4.lookAt(viewMatrix,[0, 0, -5], [0, 0, 0], [0, 1, 0]);
mat4.perspective(projMatrix,glMatrix.toRadian(45), canvas.width / canvas.clientHeight, 1e-4, 1e4);
//send matrices to shader
gl.uniformMatrix4fv(matWorldMatrixLocation, false, worldMatrix);
gl.uniformMatrix4fv(matViewMatrixLocation, false, viewMatrix);
gl.uniformMatrix4fv(matProjMatrixLocation, false, projMatrix)