All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rhino1.7.6.testsrc.doctests.413838.doctest Maven / Gradle / Ivy

Go to download

Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.

There is a newer version: 1.7.15
Show newest version
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

js> var map = new java.util.HashMap();
js> map.put("a","hi");
null
js> map.put("b","hi");
null
js> map.get("a") == map.get("b")
true
js> map.put("c",1)
null
js> map.put("c",1)
1.0
js> map.put("d",1)
null
js> map.get("c") == map.get("d")
true
js> map.get("a") == map.get("d")
false
js> map.put("e","1")
null
js> map.get("d") == map.get("e")
true
js> map.put("f", true)
null
js> map.put("g", true)
null
js> map.get("f") == map.get("g")
true
js> var obj = {}
js> map.put("h", obj)
null
js> map.put("i", obj)
null
js> map.get("h") == map.get("i")
true
js> map.put("j", {})
null
js> map.get("i") == map.get("j")
false




© 2015 - 2024 Weber Informatics LLC | Privacy Policy