I'm not an expert, but I believe the disappearing WiFi on my 2017 Macbook 15" pro is a software issue. I suspect Mojave, since I recently 'upgraded' to it. Many times I've lost WiFi contact to everything attached to my router. I have a DSL internet link and a HDHomerun SiliconDust TV box attached to it. The failure happens rather slowly, but eventually the only device shown when I click the WiFi icon (which is often black even though WiFi is dead) is my own home router. When WiFi is working, many routers from around my neighborhood show up, for instance one called Gorsline. There's even one without password protection that I occasionally try out just in case, 'wifi-2D....'. When WiFi fails, only my own router shows up, but I'm pretty sure that it's *not* actually connected. This condition is usually noted in 'Network Preferences'.
Turning wireless off then on has never worked for me.
One time during failure, I killed the 'Wireless....' app and immediately WiFi started working. But later, this didn't work.
Because it usually happened near 6 PM, when I had an external video projector connected through my USB ports, I thought the USB connection was at fault. I vowed to *not* plug into the USB ports and see if it ever failed. Today, near noon, it failed again.
This time, I 'Shut Down' my Mac. After it seemed to have gone totally dark, with no response to keys like 'caps lock', I hit the power button, and it booted back up. Voila, wireless is back.
This problem happened shortly after I 'upgraded' to Mojave 10.14.2. One rule of thumb I have: look at the last thing that was changed. I believe 10.14.2 is at fault.
In the future, until Apple issues a bug fix, I plan to reboot my computer if it loses WiFi connection. I can do that in about 10 minutes now.
22 Feb. update. I called Apple, and eventually reached a person who knew something. He had me do an SMC reset, and my WiFi problem went away.