Your main issue was capitalisation of a variable.
I have been through and added some comments, as well as fixed the variable.
You can have a look here - https://codepen.io/volv/pen/BmRBWZ?editors=0011
Hey, /u/bdenzer!
I've seen you around in some of the subs; nice to meet you! :)
Yeah... I actually went to a "computer camp" back when I was in high school (early 2000s). I learned a little html and liked it, but I didn't fall in love with it. I want to school for psych and then again for education/counseling. Then I rediscovered coding and learned that I do in fact love it! I code at least a little something every day! Hindsight is 20/20; I really wish I would have gone to school for cs or development or design or whatever.
Anywho... Yeah, cool! I like FCC. I've got a few of the new js challenges to finish (love those!) and then the Simon Game, Tic Tac Toe (started), the Wiki reader, and Camper News or whatever it is. Then done! :)
Basic SASS is relatively simple... SCSS is SASS that uses pretty much the same syntax as plain old CSS... it gives you a lot more functionality (variables and conditional logic and the like!). If you're interested: http://sass-lang.com/guide
But yeah, cool! Welcome!
If we get this place/sub up and running, what do you want to see from it? What's your preliminary vision for it?
Variables are just storage space. Do you see why yours didn't work? There is no problem in calling a function with just a number if required.
I've went over the code and gave some comments here if you like
If it still doesn't make sense let me know and can try to be more specific
https://codepen.io/volv/pen/dJMKpy?editors=0012
The bugs has been fixed on the code I posted but the alert "player one wins" or two is not showing up. https://codepen.io/ApDev/pen/RjvqqX Here is the instructions for my final project: Cards are shuffled and assigned to the two players. Required: play two suit. Extra credit: play all four suits Display the players cards after shuffle For each hand, the next card in the deck is played. Extra credit, let the player pick the next card. If card values are equal, the cards are added to a hold array. If card values are unequal, both cards played are added to the player's winnings array, as are any cards in the hold area. If a player runs out of cards, the cards in the winnings array are transferred to the player's hand. No score is kept. The game is played until one player has all the cards. Use a button to begin the game. Extra Credit - add a timer to the play.
Looks like you have the idea. If I was to tidy it up a bit and keep the output exactly the same I might do it something like this
https://codepen.io/volv/pen/BmMwWO?editors=1010
Let me know what you think
There are quite a lot of issues throughout.
I have fixed the formatting and added some comments.
Its still far from working but possibly a start (and actually gets into the gameplay bit now)
Give it another go and let me know if any specific bits present issues.
https://codepen.io/volv/pen/bYzqxL?editors=0011
Pared down to essentially just
function printList(list){
let listHTML = '';
for (var i = 0; i < list.length; i ++){
listHTML += '<li>' + list[i].name + '</li>';
}
outputDiv.innerHTML = listHTML;
}
Or
let printList = list => list.forEach(each => outputDiv.innerHTML += <li>${each.name}</li>
);
Can see it here - https://codepen.io/volv/pen/NwoRGg?editors=1010
You are on the right track. You code will work (Once that array is fleshed out).
I have went through your code and added some notes. As well as my version and hints towards the extra credit.
Can check it out here - https://codepen.io/volv/pen/vWjgMv?editors=0010
I went through, fixed formatting and bounce logic, and added some comments with some thoughts.
Can have a look here - https://codepen.io/volv/pen/EbZrdP?editors=0010
Let me know ho w you get on from there :)
If you can use Moment.js you could do something like:
const differenceInMonths = moment(putYouracquisitionDateHere).diff(moment(), 'months');
There's probably also a way to do this in plain JavaScript, but it will be a bit more complicated.
Learning Operating Systems will have a huge impact on how you create software in general. I'd suggest you take that class regardless. There are tons of resources online to learn JavaScript, like https://www.freecodecamp.org/ and many others. But, it's very hard to find a proper OS class online. Good luck with your learning. :)