<script>window.extractKey = 'value'</script>
I have to extract value of window.extractKey which is present in my html source code.
P.S.- I have to extract the value using javascript methods.
All script tags on a page have, and modify, the same window. It works fine:
<script>
window.extractKey = 'value'
</script>
<script>
const res = window.extractKey;
console.log(res);
</script>