How to end JQuery function in if()

I tried to end JQuery function using return; but I want to stop function before running more line of function. My code is here :

    var variable = $('#var').val();
    if (variable == null) {
        alert('variable is null.')
    //Normal code

When I try to test it //Normal code will be run and return; cannot stop running more lines.

Note: I can’t use else because of reasons in my codes.

Leave a Reply

Your email address will not be published. Required fields are marked *