I like succinct ternary statements, but I just found this and I kinda want to hit someone
const data = SOME_VALUE const url = data ? data.startsWith('http') ? data : `https://${data}` : '#'disgusting
I like succinct ternary statements, but I just found this and I kinda want to hit someone
const data = SOME_VALUE const url = data ? data.startsWith('http') ? data : `https://${data}` : '#'disgusting
I prefer more, less dense lines, personally, so I almost never use the ternary operator.
076萌SNS is a social network, courtesy of 076. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.
All 076萌SNS content and data are available under the Creative Commons Attribution 3.0 license.