'my number is '+Text($feature.id) +', how do you do?'
is the same as
`my number is ${$feature.id}, how do you do?`
Backticks and Line Breaks
'we want a long string'+ TextFormatting.NewLine+'and we are willing'+ TextFormatting.NewLine+'to work for it'
is the same as
`we want a long stringand we are willingto work for it`
Use SQL Functions
GroupBy and Distinct
Pass SQL commands to server
Let the server do all the work
Returns a FeatureSet for you, no cobbling together a dictionary
Use the ObjectID to get the same features but with new fields
Consider Data Expressions
Faster than standard layers when done right
Limit incoming fields
Omit geometry if not needed
Flexible output
Use the Console Command
Pass things to Console('some message')
Great for debugging an expression
Messages get sent to your browser console, too!
Whitespace is Free
Use line breaks and spaces
No bonus points for conserving code lines
No trophies for Maximum Terseness, sorry
var clear_variable =Iif( i_can_understand == True,'this is good','this is not good')var tidy_dict = {one:1,two:2,three:3,four:4}
Comment!
You may not be the only person to look at your code.
You may forget why you wrote it that way two years ago.
Leave comments
/* Here is a longer explanation of the next section of code. I figure you might need the explanation. */for (var n in m) {// and here's where we do the next thingIncomprehensibleFunction(some_variable)}// Future Me, you're welcome!