Js counts the number of spaces

var a = ["a", "b", "c", ""]; the calculated result of
is
{

.
a:3,
b:2,
c:1

}

Mar.21,2022

var a = ['a', '', '', '', 'b', '', '', 'c', ''];

let b = a.reduce((d, v) => void (v ? (d.k = v) && (d.v[v] = 0) : d.v[d.k] += 1) || d, {v: {}, k: ''}).v;

console.log(b);

((a, _) => a.reduce((p, c) => 
[_ = c || _, _ && [p[_] = p[_] || 0, !c && (p[_] PP)], p][2], {}))
(["a","","","","b","","","c",""], undefined)

ignores all empty characters before the first non-null character.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ec6a6d-2de9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ec6a6d-2de9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?