How to change how long notifications stay on a Mac? I have a webpage that will display notifications to OS X's notification (system notifications).  But it will disappear in 10 to 15 seconds.  Is there a way to change how long it stays?  (and what about change to not disappear at all?)

I found several pages dated 2014, which suggested using

defaults write com.apple.notificationcenterui bannerTime 60


or use 3 instead to make it 3 seconds. But this method doesn't work for my Mavericks and El Capitan OS X.
I was able to get this to work as of Catalina (10.15.2)

First, you need to specify -int before the number of seconds parameter:

defaults write com.apple.notificationcenterui bannerTime -int 2


You then need to restart the NotificationCenter process by signing out/rebooting or running:

killall NotificationCenter