snowberb – 09-35 Jan 2

What's better? const header = isPhone ? intl.formatMessage({ id: 'testimonials.titleMobile' }) : intl.formatMessage({ id: 'testimonials.title' }); or const header = intl.formatMessage({ id: isPhone ? 'testimonials.titleMobile' : 'testimonials.title' });
N
Nesho107d ago
Functionally the same thing. I'd prefer the second one for simplistic use-cases like this.
UU
Unknown User107d ago
N
Nesho107d ago
Better and better…functionally they’re the same. First one is just more verbose.
UU
Unknown User106d ago