You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can already do an object destruction but not in the parameters, example:
function someFunction(obj)
prop1, prop2 = ...obj
print(prop1, prop2)
end
However, we could also add the version you mentioned, have you seen similar syntax yet? (like a documentation of some languages or something) @MrFreex what do you think?
I've been searching for any documentation on how to implement it, but haven't found anything. What i've came up with is just replacing the destructured object in the parameters with a dummy parameter name, such as __parameter, and then replacing the used propperties of the object inside the function with __parameter.property. Example:
#beforepreprocessingfunctionmyFunction({ prop1, prop2 })
print(prop1, prop2)
end
#afterpreprocessingfunctionmyFunction(__parameter)
print(__parameter.prop1, __parameter,prop2)
end
Hi, it would be nice if this syntax could be implemented:
The text was updated successfully, but these errors were encountered: