text: Update frequency of A [ i ]
code: if ( frequency . has ( A [ i ] ) ) frequency . set ( A [ i ] , frequency . get ( A [ i ] ) + 1 ) else frequency . set ( A [ i ] , 1 ) ; } frequency . forEach ( ( value , key ) => {