-
Notifications
You must be signed in to change notification settings - Fork 1
Description
The syntax format that we have right now are as follows:
so we are doing this thing of, naming function argument, like this testMode
puter.ai.txt2vid(prompt, testMode = false)
the thing is, javascript don't support this type of assign param by name, it's a python thing
(https://stackoverflow.com/questions/11495031/python-passing-parameters-by-name)
but thankfully JS is super forgiving so nothing is broken in this code, what happens instead in the code is
- it declares a variable called
testMode - it assigns the value
falseto thistestModevariable - this
testModevariable/reference is then passed to the function
it all happens in one line.
a side effect of this is, it creates a variable named testMode that can be accessed outside the scope of the function
i first noticed this when my javascript linter auto lint this syntax to have parentheses
^ this version is also working, because it's doing the same thing as previous one, just with parentheses to create grouping
so the main point of this issue is, which syntax styling do we want to show in our docs