# Ternary Operator - Please help me understand this line of code

**URL:** <https://forum.kirupa.com/t/ternary-operator-please-help-me-understand-this-line-of-code/324091>\
**Category:** flash\
**Created:** [August 1, 2011, 9:50pm UTC](https://forum.kirupa.com/t/ternary-operator-please-help-me-understand-this-line-of-code/324091 "2011-08-01T21:50:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SquirtGun](https://avatars.discourse-cdn.com/v4/letter/s/f07891/32.png) [@SquirtGun](https://forum.kirupa.com/u/SquirtGun)\
**Post date:** [August 1, 2011, 9:50pm UTC](https://forum.kirupa.com/t/ternary-operator-please-help-me-understand-this-line-of-code/324091/1 "2011-08-01T21:50:30Z")

</div>

Hello all,

I recently took over a project and I am trying to wrap my head around this line of code which uses the Ternary Operator. I am only familiar with the basics. I don’t quite understand the nested nature of this.

var s:String = ( index % 3 == 0 ) ? ( index == array.length-1 ) ? “Z” :“L” : " ";

Thanks in advance!

~squirt
