a popup screen said my computer was locked and to call this number (1-877-342-2334). I did. The man said he was with Microsoft support. Was he really?
https://www.google.com/search?q=877-342-2334
No. That's a common scam called the tech support scam. You don't say that you gave them access to the computer or agreed to pay them anything. If you did not... good decision.
That was a JavaScript generated message you saw simply because you landed on that webpage.
If you were not able to close that window, if the computer was actually "locked" a pull-the-plug hard reboot will let you escape this as will closing all browser processes from Task Manager [Ctrl+Shift+Esc]
If the screen reappears when you open the browser, clear the cache. There's no malware installed... nothing else you need to do.
https://www.refreshyourcache.com/en/home/
Don