This message was deleted.
# suitescript
s
This message was deleted.
a
pretty sure all version of SS support ternary operators? its been in javascript for a very long time
🙌 1
c
2.1 does support ternary operators, 2.0 did not.
s
pretty simple to test out.
a
2.0 doesn't support ternary operators?
c
I'll be damned, after testing it out, 2.0 does support ternary operators.
a
I think optional chaining might be new in 2.1? but ternary has been around since... I want to say the 90s?
1
c
Correct, optional chaining is newer and is not supported by SS2.0. That I do actually know. I thought ternary operators were an ES6 thing for some reason, but apparently that's not the case.
👍 1
s
I love optional chaining, especially for very deeply nested objects, makes the code so much simpler in those cases
plusone 1
s
I try to prefer code that doesn't need much or deep optional chaining 🙂
s
Agreed, but I can’t control the data being sent to some of our restlets, and it has been very nice to have on a few occasions where I need to get one deeply nested value, which may or may not exist, and it’s parent may or may not exist, but don’t care about the rest of the data.
a
yeah that's absolutely the perfect use case 🙂