How to change the color of a Material at Runtime?

How can we change the color or shading of a material in JavaScript in WLE?

this.object.getComponent('mesh').material.diffuseColor = [1, 0, 0, 1]
Replace “diffuseColor” with whatever material property you’d like to change.