This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function foo () { | |
export default 'bar' // Syntax Error | |
} | |
foo() | |
// --- // | |
function foo () { | |
return 'bar' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export var foo = 'bar' | |
setTimeout(() => foo = 'baz', 500) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foo = 'bar' | |
var bar = 'foo' | |
export { foo, bar } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foo = 'bar' | |
export { foo as fuz } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var api = { | |
foo: 'bar', | |
baz: 'fooz' | |
} | |
export default api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { default, map } from 'lodash' | |
import { default as _, map} from 'lodash' | |
import _, {map} from 'lodash' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
Object.defineProperty(target, 'foo', { value: 'bar' }) | |
// Sucesso | |
} catch (e) { | |
//Erro | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let success = Reflect.defineProperty(target, 'foo', { value: 'bar' }) | |
if (success) { | |
//Yeah! | |
} else { | |
// Ops... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let obj = { foo: 'bar', baz: 'wat' } | |
delete obj.foo | |
console.log(obj) // <- { baz: 'wat' } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let obj = { foo: 'bar', baz: 'wat' } | |
let result = Reflect.deleteProperty(obj, 'foo') | |
console.log(obj) // <- { baz: 'wat' } | |
console.log(result) // true |