O'Reilly logo

Scripting in Java: Integrating with Groovy and JavaScript by Kishori Sharan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 4

image

Writing Scripts in Nashorn

In this chapter, you will learn:

  • How to write scripts in Nashorn
  • The difference between running the script in strict mode and nonstrict mode
  • How to declare variables and write comments
  • Primitive and object data types, and how to convert values of one data type to another data type
  • Operators, statements, and creating and invoking functions in Nashorn
  • Different ways of creating and using objects
  • Variable scoping and hoisting
  • About built-in global objects and functions

Nashorn is a runtime implementation of the ECMAScript 5.1 specification on the JVM. ECMAScript defines its own syntax and constructs for declaring ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required