In terms of the code you provided, the
String.prototype.count() method must be predefined. Unfortunately, There is no such method defined. That's why the cord doesn't work.
"Can A 'command' be used for B?It has to change to the question, "Is 'Method A' available in B?" and so it has to lead to the process of finding B's specification and finding A there.
The desired action should not be called simply 'count', but 'occurrence count'. (*English count refers to the act of recklessly counting heads. For example, PHP's
count($a) built-in function counts how many things are in
© 2022 pinfo. All rights reserved.