First of all: I am quite new to Javascript and HTML. I encountered a problem/question that falls to the category beginner for sure, but I don't know what to search for to get the answer. I want to do something like this:\[code\]<script type="text/javascript"> var map; $(document).ready(function () { this.map = new GoogleMap(); this.map.initialize(); }); var addMarker = function(lat, lng, address) { this.map.addMarker(lat, lng, address); };</script>\[/code\]The function \[code\]addMarker\[/code\] I want to call from razor:\[code\]@foreach (var item in Model.Companies){ <script> addMarker(@item.Latitude, @item.Longitude, '@item.Address'); </script>}\[/code\]The problem is that \[code\]map\[/code\] is not declared in the scope of the method. What is the correct approach to make this woking?Thanks in advanced for every hint.