collateCommentsByPosition(node) {
        var collatedComments = [
            [], // leading
            [], // trailing
            [], // remaining
        ];

        if (node.comments == null) {
            return collatedComments;
        }

        return node.comments.reduce(([leadingList, trailingList, remainingList], comment) => {
            if (comment.leading) {
                leadingList.push(comment);
            } else if (comment.trailing) {
                trailingList.push(comment);
            } else {
                remainingList.push(comment);
            }

            return [leadingList, trailingList, remainingList];
        }, collatedComments);
    }
// Separate leading, trailing and remaining comments into three lists
Separate leading, trailing and remaining comments into three lists
Separate leading trailing and remaining comments into three lists
collateCommentsByPosition(node) {
        var collatedComments = [
            [], 
            [], 
            [], 
        ];
        if (node.comments == null) {
            return collatedComments;
        }
        return node.comments.reduce(([leadingList, trailingList, remainingList], comment) => {
            if (comment.leading) {
                leadingList.push(comment);
            } else if (comment.trailing) {
                trailingList.push(comment);
            } else {
                remainingList.push(comment);
            }
            return [leadingList, trailingList, remainingList];
        }, collatedComments);
    }
collateCommentsByPosition ( node ) { var collatedComments = [ [ ] , [ ] , [ ] , ] ; if ( node . comments == null ) { return collatedComments ; } return node . comments . reduce ( ( [ leadingList , trailingList , remainingList ] , comment ) => { if ( comment . leading ) { leadingList . push ( comment ) ; } else if ( comment . trailing ) { trailingList . push ( comment ) ; } else { remainingList . push ( comment ) ; } return [ leadingList , trailingList , remainingList ] ; } , collatedComments ) ; }
Separate leading, trailing and remaining comments into three lists
Separate leading trailing and remaining comments into three lists
// leading // trailing // remaining