Saturday, May 31, 2025
Latest:
  • German Pronouns with Nominative, Accusative, and Dative cases
  • German articles for the nominative, accusative, and dative cases
  • Der kleine Vogel und die Sonne
  • German alphabet pronunciation
  • Command design pattern
Upokary

Upokary

Quality information

  • Health
  • Life
  • Fashion
  • Food
  • Code
  • English
  • বাংলা
Technology 

Find if the sum of two integers is equal to the given value

Published: February 10, 2022
   const verifySum = (arr, total) => {
       for(let i = 0; i < arr.length ; i++ ){
           for(let j = 0 ; j < arr.length; j++) {
               if (i === j) {
                   continue;
               }

               if(total === arr[i] + arr[j]) {
                   return true;
               }
           }
       }
       return false;
   }

   const input = [5, 7, 1, 2, 8, 4, 3];
   console.log(verifySum(input, 15));

You May Also Like

Inheritance in JavaScript

August 29, 2021 beroza

How to get radio button value using JavaScript?

July 16, 2019 beroza

How to convert timestamp to date object in JavaScript?

April 15, 2021 beroza

How to compile TypeScript in command line?

April 26, 2022 beroza

How to get number of bits set to 1 of a binary number?

November 7, 2021 beroza

What are the differences between properties and attributes in JavaScript?

August 31, 2021 beroza

What are the differences between == and equals() in Java?

January 25, 2020 beroza

TypeError: Cannot add property X, object is not extensible

July 29, 2021 beroza

Error creating bean with name ‘requestMappingHandlerMapping’ spring boot

January 27, 2019 beroza

Why Upokary?

Upokary.com is a useful application in everyday life. It provides very handy information regarding every aspect of life. Each and every tip of upokary.com is meant to make life better.

Upokary tools

  • Youtube thumbnail
  • Youtube video downloader

Useful Links

  • Handy code
  • Technology
  • People
  • Programming
  • Quote
  • Travel
  • WordPress
  • IELTS
  • Kids

Languages

  • EnglishEnglish
  • বাংলাবাংলা

Pages

  • Sitemap
  • Privacy policy
  • About us
  • Contact us

Support

For any kind of query or question please drop a message in the following email: upokary@gmail.com
Copyright © 2025 Upokary. All rights reserved.