Ye, I should have made it to return null/undefined when there is no 'x' or 'o'. I guess a case can be made that in string 'abc' we have an equal amount of nothing with respect to 'x' and 'o'. Thanks for your feedback.
Object is a proper noun in JavaScript, because Object is an object in the language standard. Since all objects inhert from Object, they are technically instances of Object as well. An object in JavaScript is therefore also an Object.
Furthermore, in JavaScript, an array is an object.
(marking as resolved)
Thanks, fixed
Thanks, fixed
Ye, I should have made it to return null/undefined when there is no 'x' or 'o'. I guess a case can be made that in string 'abc' we have an equal amount of nothing with respect to 'x' and 'o'. Thanks for your feedback.
Object is a proper noun in JavaScript, because Object is an object in the language standard. Since all objects inhert from Object, they are technically instances of Object as well. An object in JavaScript is therefore also an Object.
Furthermore, in JavaScript, an array is an object.