Bash argument set

Check if a bash argument is set in a script

File varcheck.sh

#!/usr/bin/env bash

if [[ ! -z ${1+x} ]]; then
    echo "var is set to '$1'";
else
    echo "var is unset";
fi

varcheck.sh will output: var is unset
Running varcheck.sh TADA will output: var is set to 'TADA'