× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Method to use JavaScript Map Object in Cordova Apps.

Indermohan Singh
Feb 19, 2015
<p>Sometimes you require JavaScript Map Object in Cordova Apps.</p> <p>During Developing my Android App I found that Map Object was missing in default Android WebView. So I decided to put my own little Implementation of it.</p> <p> </p> <p>Here is the little code you can use for your cordova apps.</p> <pre><small><code>// map.js</code></small> <small><code>// Map for your Cordova Project </code></small> <small><code>function Map() {</code></small> <small><code> var data = []; </code></small> <small><code> // Set Function</code></small> <small><code> this.set = function(key,value) {</code></small> <small><code><span style="font-size:13px"> </span>data[key] = value;</code></small> <small><code> } </code></small> <small><code> // Get Function</code></small> <small><code> this.get = function(key) {</code></small> <small><code> return data[key];</code></small> <small><code> }</code></small> <small><code>}</code></small></pre>
comments powered by Disqus