From 83cfdefa061cc6ed7284dae2794b554342b1256e Mon Sep 17 00:00:00 2001 From: Harish sambasivam <39916450+harishsambasivam@users.noreply.github.com> Date: Wed, 1 Jul 2020 15:43:51 +0530 Subject: [PATCH 1/3] fixed issue with delete operator using delete operator in arrays ,element remains undefined. so splice is the clean way to do that --- Data-Structures/Stack/Stack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data-Structures/Stack/Stack.js b/Data-Structures/Stack/Stack.js index 8be28006a7..4c094cda80 100644 --- a/Data-Structures/Stack/Stack.js +++ b/Data-Structures/Stack/Stack.js @@ -29,8 +29,8 @@ var Stack = (function () { } this.top-- - var result = this.stack[this.top] - delete this.stack[this.top] + let result = this.stack[this.top]; + this.stack = this.stack.splice(0,this.top); return result } From 85b860d340e3003eb63ee67f5b822863b92a067f Mon Sep 17 00:00:00 2001 From: Harish sambasivam <39916450+harishsambasivam@users.noreply.github.com> Date: Sun, 19 Jul 2020 10:15:15 +0530 Subject: [PATCH 2/3] Fixed the semicolon and let errors --- Data-Structures/Stack/Stack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data-Structures/Stack/Stack.js b/Data-Structures/Stack/Stack.js index 4c094cda80..668edbbe12 100644 --- a/Data-Structures/Stack/Stack.js +++ b/Data-Structures/Stack/Stack.js @@ -29,8 +29,8 @@ var Stack = (function () { } this.top-- - let result = this.stack[this.top]; - this.stack = this.stack.splice(0,this.top); + var result = this.stack[this.top] + this.stack = this.stack.splice(0,this.top) return result } From 24e6e066a125338d5b2783deca9d76da2d760452 Mon Sep 17 00:00:00 2001 From: Harish sambasivam <39916450+harishsambasivam@users.noreply.github.com> Date: Mon, 20 Jul 2020 07:02:35 +0530 Subject: [PATCH 3/3] Update Stack.js --- Data-Structures/Stack/Stack.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Data-Structures/Stack/Stack.js b/Data-Structures/Stack/Stack.js index 668edbbe12..f95b940599 100644 --- a/Data-Structures/Stack/Stack.js +++ b/Data-Structures/Stack/Stack.js @@ -30,7 +30,7 @@ var Stack = (function () { this.top-- var result = this.stack[this.top] - this.stack = this.stack.splice(0,this.top) + this.stack = this.stack.splice(0, this.top) return result } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy