Getting all URLs of uploaded images using media uploader

Got it working with a code from this question
https://stackoverflow.com/questions/14847668/get-url-of-freshly-uploaded-image-from-wp3-5-media-uploader

Maybe somebody will find it useful. This code logs URL of every freshly uplaoded image to console.

jQuery(document).ready(function($){
$('#upload-btn').click(function(e) {
    e.preventDefault();
    var image = wp.media({
        title: 'Nahranie obsahu',
        // mutiple: true if you want to upload multiple files at once
        multiple: true
    }).open()
        .on('select', function(e){
            // This will return the selected image from the Media Uploader, the result is an object
            var uploaded_images = image.state().get('selection');

            var attachment_ids = uploaded_image.map( function( attachment ) {
                attachment = attachment.toJSON();
                console.log(attachment.url);
            }).join();

            // We convert uploaded_image to a JSON object to make accessing it easier
            // Output to the console uploaded_image
           // console.log(uploaded_image);
            var image_url = uploaded_image.toJSON().url;
            // Let's assign the url value to the input field
            $('#image_url').val(image_url);
        });
});
});