Skip to content

Instantly share code, notes, and snippets.

View sagrath23's full-sized avatar
:octocat:
making things

Steven Augusto Villegas sagrath23

:octocat:
making things
View GitHub Profile
@sagrath23
sagrath23 / index.js
Created October 3, 2023 16:34
balanced brackets
const OPEN_SYMBOLS = ['{', '[', '('];
const CLOSE_SYMBOLS = {
')': '(',
']': '[',
'}': '{'
};
function isBalanced(s) {
const heap = [];
// EN-us.js
export const labels = {
"foo": "Foo message in english"
};
// ES-co.js
export const labels = {
"foo": "Mensaje de Foo en español"
};
// i18n.js
import { labels as spanishLabels } from './ES-co.js';
// 1. Given the following code, determine the output of object.hi
let object = {
some: "foo",
bar: "some",
hi: () => {
console.log(`${this.some}, ${this.bar}`);
}
};
object.hi(); // should output "undefined, undefined" because scope of this pointer in arrow function is different from class

Keybase proof

I hereby claim:

  • I am sagrath23 on github.
  • I am sagrath23 (https://keybase.io/sagrath23) on keybase.
  • I have a public key ASACuLxlgPldIiZ0_bUAjrcMYTlpgzn0fKINIn9-v38lVgo

To claim this, I am signing this object: