We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12233c3 commit 5df2d5eCopy full SHA for 5df2d5e
1 file changed
Programs/Array/mismatch.js
@@ -0,0 +1,19 @@
1
+
2
+/*
3
+check string compare it to array that Hallo is differnt from Hello so return e
4
+*/
5
+let arr = ["hi", "Hello"];
6
+let str = "Hallo";
7
8
+for (let word of arr) {
9
+ if (word.length === str.length) {
10
+ for (let i = 0; i < word.length; i++) {
11
+ if (word[i] !== str[i]) {
12
+ console.log(word[i]); // This is the mismatching character from the array
13
+ break;
14
+ }
15
16
17
+}
18
19
0 commit comments