Way more often, and as antiaircraft platforms. They were studded with dual purpose 5 inch batteries, and other 40 and 20 mm.
While I love the big BB's and I'm one of the few who appreciate the oddity that is the Alaska Class, their main disadvantage was that their cost didn't justify their construction relative to simply building more cruisers as AA platforms. I just made this chart from WIKI:

Weight is a pretty good rough proxy for cost. The ships are the Iowa Class Battleships, the Alaska Class Large Cruisers (arguably Battlecruisers but not according to the USN), Baltimore Class Heavy Cruisers, and Cleveland Class Light Cruisers. The main armament is a different issue entirely but that wasn't used against aerial targets anyway*. Simply for AA purposes, the above is what each ship carried during WWII.
Note also that the range is longest/highest for the larger guns and shortest for the smaller guns so the most effective guns are the 5" while the 40MM and especially the 20MM are less effective particularly at defending another ship. These, especially the 20MM are mostly close-in weapons for use against targets that got past the 5" and have probably already dropped their ordinance so the damage is already done.
So for roughly the same cost you could build two Iowa's, three Alaska's, seven Baltimore's, or eight Cleveland's and here is the number of each weapon you'd get by doing that:

Strictly as AA platforms, the Iowa's and Alaska's are insanely inefficient choices. The more numerous ships also have the advantage of being able to spread out their fire since there are more of them so they can be sent in different directions and while a hit on one of them will be more damaging it will only be damaging to THAT ship, the other seven Cleveland's or six Baltimore's will remain undamaged from a single hit.