Kronecker delta δij\delta_i^j,δij\delta_{ij}, δij\delta^{ij}, ...

This Kronecker delta (greek lowercase delta) δij\delta_i^j is pretty simple: If the two indices i and j are the same, its value is 1, otherwise 0.

Written with cases (see previous section):

δij={1if i=j0else \delta_i^j = \begin{cases} 1 & \text{if } i = j \\ 0 & \text{else} \end{cases}

You might find this symbol with various placements of the indices, as indicated in the title. In some context, e.g. tensors, this placement is important, but often times it isn't.

Code:

function kroneckerDelta(i,j){
    if(i === j){
        return 1;
    } else {
        return 0;
    }
}