perhaps something like this?

~~~
function isLocked(icc) {
}

...

if (isLocked(this.icc0) { ...
~~~~