I need help understanding what a line in a JavaScript algorithm does

Im working on breaking down an algorithm called Top K Frequent Elements below i have the link to the problem and the solution. I cant understand what the 4th line is doing specifically on the right side of the = sign, could someone explain to me what it is that im assigning to the map[elements], it seems to perhaps be short hand for some type of if conditional because of the || statement but that is my best guess. If im missing any information or if my question is not clear please let me know and I will update the question as soon as I can
https://leetcode.com/problems/top-k-frequent-elements/description/

var topKFrequent = (nums, k) => {
let map = {}
for(let element of nums){
    map[element] = (map[element] || 0) + 1
}
return Object.entries(map).sort((a,b) => b[1] -a[1]).map(val=>Number(val[0])).slice(0,k);
}