News for hackers. Stuff that matters.
Re:Apple Developer Documentation Is Missing by AgloeDreams on Monday October 28, 2019 @10:46AM (#21377453)
I'm not sure how it looks in ObjC but in Typescript you could write something like:

  let studentScoreFormatted: string = student.formattedScore ?? 'Student has not taken this test yet.';
Whereas if the score is null it will return the value after `??`.

It is awfully helpful for ensuring you handle error states in displaying API values. Additionally if you want this behavior but when the value is falsey, then you can use `||` instead.

Re:Apple Developer Documentation Is Missing by leshow on Monday October 28, 2019 @12:07PM (#21378190)
?? doesn't exist in typescript yet, but there is a tc39 proposal to add it to js proper
Re:Apple Developer Documentation Is Missing by AgloeDreams on Monday October 28, 2019 @02:02PM (#21379673)
TS 3.7 adds it.
Re:Apple Developer Documentation Is Missing by jamil7 on Monday October 28, 2019 @11:55AM (#21378057)
Do you mean Swift? I didn't think Typescript had something like this yet.
Re:Apple Developer Documentation Is Missing by h0h0h0h0111 on Monday October 28, 2019 @12:07PM (#21378189)
Not sure about OP, but this is coming in Typescript 3.7 I believe. Currently you can use `||`, but as mentioned above it will also catch false, 0, "", etc
Re:Apple Developer Documentation Is Missing by AgloeDreams on Monday October 28, 2019 @02:17PM (#21379876)
Bingo. TS 3.7