Q:

get value of have i visited this website prior to today in js

Here as shown in image I want to  get value of "have i visited this website prior to today?"
I have tried "https://developer.mozilla.org/en-US/docs/Web/API/Window/history" but its returns browser current session history only not the previous.

A:

Well, you have to create your own cookie and add javascript code which would increment cookie value by 1 each time when user visited site. 
Cookie shall be valid for certain period of time: from the moment user access site until the end of day. 
Checkout links below, that are use full for your case:

JS Visitor caunter
User cookie to count user visits

