function add(input1,input2) {
	var number1 = input1.toString();
	var number2 = input2.toString();
	var numbers1 = new Array();
	var numbers2 = new Array();
	var size1 = 0;
	var size2 = 0;
	while(size1 < number1.length) {
		var SizeAndNumberToAddToNumbers1Array = 0;
		var Number1FromFunctionAddLength = number1.length-size1-1;
		SizeAndNumberToAddToNumbers1Array = number1.charAt(size1);
		while(Number1FromFunctionAddLength > 0){
			SizeAndNumberToAddToNumbers1Array = SizeAndNumberToAddToNumbers1Array + "0";
			Number1FromFunctionAddLength = Number1FromFunctionAddLength-1;
		}
		numbers1.push(SizeAndNumberToAddToNumbers1Array);
		size1 = size1 + 1;
	}
	while(size2 < number2.length) {
		var SizeAndNumberToAddToNumbers1Array2 = 0;
		var Number1FromFunctionAddLength2 = number2.length-size2-1;
		SizeAndNumberToAddToNumbers1Array2 = number2.charAt(size2);
		while(Number1FromFunctionAddLength2 > 0){
			SizeAndNumberToAddToNumbers1Array2 = SizeAndNumberToAddToNumbers1Array2 + "0";
			Number1FromFunctionAddLength2 = Number1FromFunctionAddLength2-1;
		}
		numbers2.push(SizeAndNumberToAddToNumbers1Array2);
		size2 = size2 + 1;
	}
	var result1 = 0;
	var saize1 = 0;
	while(saize1 < numbers1.length){
		var topush1 = numbers1[saize1];
		result1=result1+parseInt(topush1);
		saize1 = saize1 + 1;
	}
	var result2 = 0;
	var saize2 = 0;
	while(saize2 < numbers2.length){
		var topush2 = numbers2[saize2];
		result2=result2+parseInt(topush2);
		saize2 = saize2 + 1;
	}
	return result1+result2;
}

advanced and optimized add function better than a + b

By Rzaba Kiddo, 2021-11-27 21:25:24