@blog6394114945 posted a new topic, subject "Functions not working properly". It read:

   Hey there!
    
    This is the first project from the functions lesson, where we have to build a rock, paper, scissors game. I can't understand why two of the determineWinner functions are not working properly. I have attached the whole exercise with comments giving details of what's happening.
    
    Hope you can help me cause I honestly can't find where the mistake is.
    
    Thanks in advance!
    [code] 
        const getUserChoice = userInput => {
          userInput = userInput.toLowerCase();
          if (userInput === 'rock' || userInput === 'paper' || userInput === 'scissors' || userInput === 'bomb') {
            return userInput;
          } else {
              control.log('Error!')};
            }
        
        const getComputerChoice = computerInput => {
          computerInput = Math.floor(Math.random() * 3);
          switch (computerInput) {
            case 0:
              return 'rock';
            case 1:
              return 'paper';
            case 2:
              return 'scissors';
          }    
        }
        
        const determineWinner = function(userChoice, computerChoice) {
          if (userChoice === computerChoice) {
            return 'It\'s a tie!';
          } 
          if (userChoice === 'bomb') {
            return 'You Win!';
          }
          if (userChoice === 'rock' && computerChoice === 'paper') {
            return 'Computer Wins!';
          } else {
            return 'You Win!'; //All conditions work
          }
          if (userChoice === 'paper' && computerChoice === 'scissors') {
            return 'Computer Wins!';
          } else {
            return 'You Win!'; //Prints else condition where it should be if. Tie woks. Else condition works when true
          }
          if (userChoice === 'scissors' && computerChoice === 'rock') {
            return 'Computer Wins!';
          } else {
            return 'You Win!'; //Same as previous variable
          }
        }
        
        const playGame = () => {
        const userChoice = getUserChoice('bomb');
        const computerChoice = getComputerChoice();
        console.log('You threw: ' + userChoice);
        console.log('The computer threw: ' + computerChoice);
        console.log(determineWinner(userChoice, computerChoice));  
        }
        
        playGame();
        
    [/code]

So @mtf replied

    blog6394114945:
    
    > const getComputerChoice = computerInput => {
    
    One trusts you are still working to resolve the issues and haven't taken that close a look, yet. Early on this caught my eye…
    [code] 
        const computerChoice = getComputerChoice();
        
    [/code]
    
    There is no argument in the call, so one expects there is no parameter at the receiving end, or at least a default parameter. It may not raise an error, though one expects it should, but there should only be `()` on the function.
    
    const foo = () => {}
    
    Will give a closer look to the rest of your code, presently.

After which, @blog6394114945 added

    Thank you!
    
    At some point I will go over it from scratch and see if I can get a different outcome. In the meantime I'll move on with the course.


{'source': 'discourse', 'url': 'https://discuss.codecademy.com/t/functions-not-working-properly/469869', 'title': 'Functions not working properly', 'views': 236, 'has_accepted_answer': False, 'word_count': 340, 'like_count': 1, 'reply_count': 1, 'participant_count': 2, 'posts': 3, 'tags': 'functions', 'author': '@blog6394114945', 'participants': '@blog6394114945, @mtf', 'image_url': [None], 'created_at': '2020-02-26T00:47:09.161Z', 'last_posted_at': '2020-02-28T09:38:38.864Z'}