[JS] - Adjusted isVisible function