Ad
Code
Diff
  • function dumbRockPaperScissors(player1, player2) {
    if (player1 = player2) {
      console.log = "Good day";
    }
    }
    • function dumbRockPaperScissors(player1, player2) {
    • if (player1 = player2) {
    • console.log = "Good day";
    • }
    • }
Code
Diff
  • const firstNonRepeatingCharacter = (str) => {
        for (let i = 0; i < str.length; i++) {
            let seenDuplicate = false;
            for (let j = 0; j < str.length; j++) {
                if (str[i] == str[j] && i != j) {
                    seenDuplicate = true;
                    break;
                }
            }
            if (!seenDuplicate) {
                return str[i];
            }
        }
        return null; // return null if no unique character is found
    };
    • const firstNonRepeatingCharacter = (str) => {
    • for (let i = 0; i < str.length; i++) {
    • let seenDuplicate = false;
    • for (let j = 0; j < str.length; j++) {
    • if (str[i] === str[j] && i !== j) {
    • if (str[i] == str[j] && i != j) {
    • seenDuplicate = true;
    • break;
    • }
    • }
    • if (!seenDuplicate) {
    • return str[i];
    • }
    • }
    • return null; // return null if no unique character is found
    • };