{"size": 292, "ext": "js", "max_stars_repo_path": "data-structures/stack/implement-by-array.js", "max_stars_repo_name": "zh-rocco/leetcode-practices", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "data-structures/stack/implement-by-array.js", "max_issues_repo_name": "zh-rocco/leetcode-practices", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "data-structures/stack/implement-by-array.js", "max_forks_repo_name": "zh-rocco/leetcode-practices", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 11.2307692308, "max_line_length": 44, "alphanum_fraction": 0.5239726027}
class Stack {
  constructor() {
    this.stack = []
  }

  push(val) {
    this.stack.push(val)
  }

  pop() {
    return this.stack.pop()
  }

  peek() {
    return this.stack[this.stack.length - 1]
  }

  size() {
    return this.stack.length
  }

  empty() {
    return !this.size()
  }
}
