How to use if statements to manipulate dynamic value content?

Is it possible to use if statements to manipulate dynamic value content? (I can’t figure out the syntax)
For example, if $ctx.graphCmsItem.array[0] returns “A”, output “B”

Hi @able_bandicoot, you can do this with

$ctx.graphCmsItem.array[0] ? "A" : "B"