JSFiddle - React, Tailwind, and code Playground

JavaScript

/*
Using the JavaScript language, have the function ArrayAdditionI(arr) 
take the array of numbers stored in arr and return the string true if 
any combination of numbers in the array can be added up to equal the 
largest number in the array, otherwise return the string false. 
For example: if arr contains [4, 6, 23, 10, 1, 3] the output should 
return true because 4 + 6 + 10 + 3 = 23. The array will not be empty, 
will not contain all the same elements, and may contain negative numbers. 
Input = 5,7,16,1,2; Output = "false" 
Input = 3,5,-1,8,12; Output = "true" // 3 not included in sum
*/

function ArrayAdditionI(arr){
  var newArr=arr.sort(); // sorted from smallest to largest.
  var largestNum=newArr.slice(-1); // Gets the last number, which would be the largest.
  var loopArr=arr.sort().pop(); // Takes out the largest number for adding later.
  var result=0;
  
  for(var i=0; i<loopArr.length; i++){ // loops through all numbers.
    if(result/largestNum !== 1){ //when you divide a number by itself it will be 1.
    	result+=loopArr[i]; // keep adding each number to each other until get result.
  	}else if(result === largestNum){
    return true;
  	}
  } 
	return false;
}


// TESTS
console.log("-----");
console.log(ArrayAdditionI([4,6,23,10,1,3]));
console.log(ArrayAdditionI([5,7,16,1,2]));
console.log(ArrayAdditionI([3,5,-1,8,12]));