asirihewage / js-challenges

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coding-Challenges

Friday Challenge : 01

DEFINE A STACK DATA STRUCTURE USING JAVASCRIPT WITH THE FOLLOWING MEMBERS

const stack = new Stack() 
stack.push(item) 
stack.pop() 
stack.count()
stack.peek() // Read the top item

CONDITIONS:

  • count should not be an instance member
  • push, pop, peek methods should be prototype members
  • Do the proper error handling

ANSWER:

npm run run:challenge1

UNIT TEST

npm run test:challenge1

Friday Challenge : 02

About

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%