<commit_before>/**
 * Implementation of the stack (LIFO) using JavaScript
 * 
 * author: <NAME> <<EMAIL>>
 *
 */
module.exports = (function Stack(){

	var stack = [];

	function push(newElement){
		stack.push(newElement);
	}

	function pop(){
		return stack.pop();
	}

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

	function getSize(){
		return stack.length;
	}

	function isEmpty(){
		return (stack.length === 0);
	}

	function clear(){
		stack = [];
	}

	var publicApi = {
		push: push,
		pop: pop,
		isEmpty: isEmpty,
		peek: peek,
		getSize: getSize,
		clear: clear<commit_msg>descriptive comments in the stack implementation<commit_after>/**
 * Implementation of the stack (LIFO) using JavaScript
 * 
 * author: <NAME> <<EMAIL>>
 *
 */
module.exports = (function Stack(){

	var stack = [];

	// inserts new element to the stack
	function push(newElement){
		stack.push(newElement);
	}

	// removes and returns the top element
	function pop(){
		return stack.pop();
	}

	// returns the top element (without removing it from the stack)
	function peek(){
		return stack[stack.length-1];
	}

	// returns the stack size
	function getSize(){
		return stack.length;
	}

	// returns true if stack is empty
	function isEmpty(){
		return (stack.length === 0);
	}

	// clears the stack
	function clear(){
		stack = [];
	}

	var publicApi = {
		push: push,
		pop: pop,
		isEmpty: isEmpty,
		peek: peek,
		getSize: getSize,
		clear: clear
{'fraction_non_alphanumeric': 0.1404728789986092, 'fraction_numerical': 0.0027816411682892906, 'mean_word_length': 3.3738601823708207, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6310009', 'n_tokens_mistral': 520, 'n_tokens_neox': 466, 'n_words': 145}