#can i bypass strict mode?

1 messages · Page 1 of 1 (latest)

celest gyro
#

When I try use Deno Run , it complains

error: Uncaught TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
const answer = o[s];

export function func(o: object, s : string) {
    const answer = o[s];
    return answer}
             ^
#

Looks like I can use javascript for the particular function if there isn't a better way

sturdy breach
#

strict mode is enabled by default and can't be disabled in ESM modules

#

and Deno is built on ESM

celest gyro
#

thank you. looks I can't even import it as java script.

#

Is there some other way when I am using

Object.getOwnPropertyNames

rather than just getting the names, to get the current values?

hollow condor
#

Object.keys()?

#
const obj = {
  a: 1,
  b: 2,
  c: 3
}

Object.keys(obj) // ['a', 'b', 'c']
Object.values(obj) // [1, 2, 3]
Object.entries(obj) // [['a', 1], ['b', 2], ['c', 3]]