Q:

Implementing notifications in my rails app following 'GoRails' tut

I've been following this tutorial for a notification system and everything has gone smoothly until I began writing Coffeescript. This script in question is:
class Notifications
constructor: ->
    @notifications = $("[data-behavior='notifications']")
    @setup() if @notifications.length > 0 

setup: -> 
    $.ajax(
        url: "/notifications.json"
        dataType: "JSON"
        method: "GET"
        success: @handleSuccess
    )

handleSuccess: (data) =>
    items = $.map.data, (notification) ->
        "<a class='dropdown-item' href='#{notification.url}>#{notification.action} #{notification.notifiable.type}</a>"

    $("[data-behavior='unread-count']").text(items.length)
    $("[data-behavior='notification-items']").html(items)

jQuery ->
  new Notifications

The error I get is from the "," following $.map.data. when I remove that, I get a new error, this time in the console saying:
Uncaught TypeError: $.map.data is not a function

The link to the tutorial
It includes a video, transcript w/ code, and a GitHub repo link. I think my problem has something to do with 'data' return an object, rather than an array.

A:

I am sure it is a typo,because map is a function and data is a parameter to this function. So the following should be the correct version of that part of script:
handleSuccess: (data) =>
   items = $.map data, (notification) ->

