I am relatively new to bash.
I had bash 3 In my mac by default.
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18) Copyright (C) 2007 Free Softw
homebrew installs programs into /usr/local/bin so if you want to use the version installed by homebrew you need to either run:
/usr/local/bin
/usr/local/bin/bash --version
or ensure that /usr/local/bin occurs before /bin on your PATH, e.g.
/bin
export PATH=/usr/local/bin:PATH