What is docker wait?

It Blocks the docker until one or more containers stop, then prints the respective exit codes

docker wait js5
Ex:
Run a docker in one terminal - docker run -dit --name=js5 ubuntu bash
Run docker wait command in another terminal - docker wait js5
Stop docker in the first terminal - docker stop js5
Exit code 0 prints on the terminal 2