function Stack() {
this.items = []
Stack.prototype.push = function (element){
this.items.push(element)
}
Stack.prototype.pop = function () {
return this.items.pop()
Stack.prototype.psek =function () {
return this.items[this.items.length - 1]
}
Stack. prototype.isEmpty = function () {
return this.items.length == o
}
Stack.prototype.size = function () {
return this.items.length
}
Stack. prototype.tostring = function () {
var resultstring = ''
for (var i = 0; i < this.items.length; i++) {
resultString += this.items[i] + ''
}
return resultstring
}
}
var s = new Stack()
function dec2bin(decNumber) {
var stack = new Stack(
while (decNumber > 0){
stack.push(decNumber % 2)
decNumber = Math.floor(decNumber / 2)
}
var binaryString =''
while (!stack.isEmpty()){
binaryString += stack.pop()
}
return binaryString