Question: Please help me out with these two JavaScript programming questions. its for exam review. let suits = [ Hearts', Spades', Clubs, Diamonds' ] ]!

Please help me out with these two JavaScript programming questions. its for exam review.

Please help me out with these two JavaScript programming questions. its for

let suits = [ "Hearts', " Spades', "Clubs", "Diamonds' ] ]! let values = [ "Are' , 2, 3 , 4, 5, 6 , 7, 8, 9, " Jack", " Queen';king' ]` 4 . Create a constructor for a Card object . A Card has a suit , and a value . A card has the ability to check if it matches another Card object . A Card matches another card if it has the same suit or the same value . function Card ( suit , value ) {| this _ suit = let suitVang = Math. floor ( Math. random ( 7* 4 ) 7\\ let values Num = Math . floor ( Math . van dom ( $ # 12 ) ;^ this . suit = vsuits [ Suit Val ] ;] MEN new Card . suit function Card ( suit , value ) {| new Card . value this . suit = Swid ; this . value = value ; this . match = function ci E .. . } } Yet first Card = new Card ( suit Val, values Num ) let second Card = new Card ( suitVal , values Num ) if ( first Card . suit = = second Card . suit 11 first Card , value = = Second Card . value ){\\ return true ;] else Veturn false 5 . Write a function that returns how many Aces are in a card hand . Your function should accept an Array of Cards as a parameter and return how many aces are in that array

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!