Home javascript JS Compare 2 lines turned twin

JS Compare 2 lines turned twin

Author

Date

Category

How to do what would compare 1 with 1, 2 with 2 letters, and not 1 with all 2 lines

var array1 = "1234",
    array2 = "143421";
  var cache;
  var cache2;
  VAR LN1 = Array1.Length
  ln2 = array2.length;
  for (var i = 0; i & lt; ln1; ++ i)
  {
    cache = array1 [i];
    for (var j = 0; j & lt; ln2; ++ j)
    {
      cache2 = array2 [j];
      if (cache == array2 [j])
      {
        Console.log ('Society found:' + Cache);
        Break;
      }
    }

Answer 1, Authority 100%

var array1 = "1234",
  array2 = "143421";
VAR LN;
if (Array1.Length & GT; Array2.Length) LN = Array1.Length; ELSE LN = Array2.Length;
for (var i = 0; i & lt; ln; i ++)
{
  If (Array1 [i] == Array2 [i]) {
    Console.log ('Society found:' + I);
    Break;
  }
}

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions