"javascript coffeescript vbscript javacode"
/(?!java)\w+script\b/ :
match form string index 1
(?!java) matched nothing
\w+ matched "ava"
script matched "script"
/(?!java)\b\w+script\b/ will be correct
\b match a character bounder, so it should not matchs from ava...
Wow, you are really serious about helping other people. Your explaination should get more voted. Thank you very much, I have learned something new from it. Keep doing the good work, and have a nice day. :)
Sure thing:
You can think of the comma operator as a way to compose multiple expressions into a single expression chain.
The expressions are evaluated in order, with each of their results discarded. The final expression however (the last one in the chain) returns its result as the result of the combined expression.
For Example:
vardoThreeThings=function() {
one(); // Evaluate expression and disregard its return valuetwo(); // Evaluate expression and disregard its return valuereturnthree(); // Evaluate expression and return its return value
}
Could be re-written with the comma operator as:
vardoThreeThings=function() {
// Evaluate one() and disregard its return value// Evaluate two() and disregard its return value// Evaluate three() and return its return valuereturnone(), two(), three();
}
This can be useful if you need to use multiple expressions in a place that can only take a single expression. However, I haven't seen many uses that wouldn't be improved by being more explicit so I try to reserve its use for code golf.
Because this function now contains a single statement, it could be further-reduced.
vardoThreeThings= () => (one(), two(), three());
Also worth noting that the comma has the lowest operator precedence, so consider parentheses.
This comment is hidden because it contains spoiler information about the solution
Fixed. I removed some pointless and broken stuff in Preloaded.
This comment is hidden because it contains spoiler information about the solution
Hey yeah, I should get rid of that test. But I cant think of an idea of how to restrict users from declaring variables outside of the function. Hrm.
Wow, you are really serious about helping other people. Your explaination should get more voted. Thank you very much, I have learned something new from it. Keep doing the good work, and have a nice day. :)
That probably should be 'lowerCase' not 'loverCase'
Hi Matorzinho!
Sure thing:
You can think of the comma operator as a way to compose multiple expressions into a single expression chain.
The expressions are evaluated in order, with each of their results discarded. The final expression however (the last one in the chain) returns its result as the result of the combined expression.
For Example:
Could be re-written with the comma operator as:
This can be useful if you need to use multiple expressions in a place that can only take a single expression. However, I haven't seen many uses that wouldn't be improved by being more explicit so I try to reserve its use for code golf.
Because this function now contains a single statement, it could be further-reduced.
Also worth noting that the comma has the lowest operator precedence, so consider parentheses.
Hope this helps!
Hi colby,
I want to know the same thing that Viktor asked but I didn't understand your answer, would you mind rephrasing it?
I always see your solutions and they are a great motivation for me, thanks!
The comma operator evaluates each of the statements, left to right, regardless of their return, and returns the result of the final statement.