In python _
is used as a throwaway variable. Is there an idiomatic accepted name in javascript?
What is this? In JavaScript, the this keyword refers to an object. Which object depends on how this is being invoked (used or called). The this keyword refers to different objects depending on how it is used: In an object method, this refers to the object.
It is not Javascript code! Instead, you will find Python code in a script of type "text/python". Brython is designed to replace Javascript as the scripting language for the Web.
Python pass Statement The pass statement is used as a placeholder for future code. When the pass statement is executed, nothing happens, but you avoid getting an error when empty code is not allowed.
The closest equivalent in all cases of what is passed to list() would be using the spread syntax from ES6. For older versions of JavaScript, you can use string. split('') for a character array.
Rigth now, you can use array destructuring, no need for a var.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
For example:
[,b] = [1,2];
console.log(b);
will output :
2
And the value 1 won't be assigned to any unused var.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With