[JS] Functions - edited