Get global variable dynamically by name string in JavaScript?

Display in alert by using alert(window()). Following is the syntax −

alert(window['yourVariableName' + 'yourVariableName' + otherVariableName]);


 Live Demo

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//">
<script src=""></script>
<script src=""></script>
   var globalVariablelocal_print100=100;
   alert(window['globalVariable' + 'local_' + print100]);

To run the above program, save the file name anyName.html(index.html) and right click on the file and select the option open with live server in VS code editor.