Skip to main content

Object-Oriented Programming in JavaScript

  • Chapter
  • First Online:
JavaScript Essentials for SAP ABAP Developers
  • 1542 Accesses

Abstract

As with ABAP, JavaScript allows you to create objects. However, the concepts pertaining to object creation in the two languages are not the same. This chapter covers object creation, instantiation, and inheritance in JS. After starting with an overview of object-oriented programming (OOP) in general, the rest of the chapter shows how OOP is implemented in JS, along with relevant syntax. It introduces the this operator in detail, then covers the various ways of creating objects, followed by the instantiation steps using the new keyword. Once you have a basic understanding of objects, the chapter moves on to inheritance as implemented in JS using prototypes. This chapter presents real-life examples of objects and subobjects throughout, along with sample code listings used for implementing them in JavaScript.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Rehan Zaidi

About this chapter

Cite this chapter

Zaidi, R. (2017). Object-Oriented Programming in JavaScript. In: JavaScript Essentials for SAP ABAP Developers. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2220-1_8

Download citation

Publish with us

Policies and ethics