I'm a self-taught dev focused on websites and Python development.
My friends call me the "Data Genie".
When I get bored, I find tech to read about, write about and build things with.
Good point in other comment on filling in very common encounters of undefined as when getting a non-existent key from an object an getting undefined (in Ruby you get null and Python you get an error) and an argument that is not defined (Python will give an error when it is not defined but in JS you must validate yourself).
Also noteworthy for how to check for undefined.
constMY_VAR=process.env.MY_VARif(typeofMY_VAR==='undefined'){thrownewError('Must set MY_VAR on environment variables')}
functionfoo(abc){if(typeofabc==='undefined'){thrownewError('abc is a required argument')}console.log(abc)}foo(123)foo(null)foo()// error
Another use is to skip positional arguments by passing a value explicitly as undefined, assuming it is optional.
foobar("abc",undefined,456)
In Python this is not need as you can switch to keyword params.
foobar("abc",third_param=456)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good point in other comment on filling in very common encounters of undefined as when getting a non-existent key from an object an getting undefined (in Ruby you get null and Python you get an error) and an argument that is not defined (Python will give an error when it is not defined but in JS you must validate yourself).
Also noteworthy for how to check for undefined.
Another use is to skip positional arguments by passing a value explicitly as undefined, assuming it is optional.
In Python this is not need as you can switch to keyword params.