Just use the jQuery.cookie plugin which is a part of Magento 2:
jQuery.cookie
jQuery.cookie('form_key');
See also:
Hi. Can you please tell if “form_key” cookie is present in every magento frontend page? Another thing where is the code that sets this cookie? Thanks