array_count_values for javascript instead
Posted
by
user626342
on Stack Overflow
See other posts from Stack Overflow
or by user626342
Published on 2011-03-07T07:48:42Z
Indexed on
2011/03/07
8:10 UTC
Read the original article
Hit count: 161
php
|JavaScript
Hi, I have the following php-script, now I need to do the same thing in javascript. Is there a funcion in javascript that works similar to the php function, I have been searching for days but cannot find anything similar? What I want to do is to count the number of times a certain word is beeing used in an array.
$interfaceA = array($interfaceA_1,$interfaceA_2,$interfaceA_3,$interfaceA_4,$interfaceA_5,$interfaceA_6,$interfaceA_7,$interfaceA_8);
$interfaceA_array=array_count_values($interfaceA);
$knappsatsA = $interfaceA_array[gui_knappsats];
$touchpanelA = $interfaceA_array[gui_touchpanel];
Many thanks linda
© Stack Overflow or respective owner