'a shorter way to change some object values to uppercase

I have a large object and need to change some values (not all of them) to upperCase

obj.state = obj.state.toUpperCase();
obj.city = obj.city.toUpperCase();
obj.street = obj.street.toUpperCase();
obj.title = obj.title.toUpperCase();

is there a shorter way, like this:

obj(state,city,street,title).toUpperCase();  

Thanks



Solution 1:[1]

if you are using AsyncWebsocketConsumer you can use:

return await self.close(code=4000)

WebSocket Close Codes

DjangoChannels Refrence

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ali Rn