How to get your local ip in OS X from terminal

I recently needed to get my local IP from the terminal in OSX and I found a crazy way to do that from this StackOverflow question

ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v ''

It does work even though I don’t really want to spend the brain power needed to understand it enough to explain it.