Yes, but if you just go out and get something like an 8 port gigabit switch, it will not do the "connect a bunch of computers to the internet through my cable modem" like a router will - going by what the average person looking for a "router" would want. I was intentionally using a simplistic description of the difference between a switch and a router. In reality, there are only hubs (dumb devices that echo everything to every port - layer 1) to switches of various types. Simple switches only use an ARP table to send data to only the correct port rather than all ports (layer 2). More advanced switches do layer 3 stuff as well (layer 3 is what a consumer "router" that does network address translation would be).
Most "switches" unless you are talking expensive managed switches would be layer 2, while consumer "routers" would be considered layer 3. In reality, they are both technically switches, just one has more features than the other.
You could very easily nuke off a network that only has "simple" layer 2 switches, by connecting cables so as to form a loop between them. Because broadcast traffic goes to ALL ports even on a switch. On a hub, all traffic goes to all ports, on a switch only broadcast traffic does. Connecting layer 2 switches together in a loop will cause a broadcast storm and effectively nuke off the network until the loop is removed. More expensive managed switches implement spanning tree protocol, so you can connect switches together in loops for redundancy without causing broadcast storms. But this is more advanced stuff that most people looking to buy a "router" would never encounter.