Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between "Client-Side JavaScript", "Server-side JavaScript" and "CoreJavaScript"

Tags:

javascript

I am reading a book (JavaScript:The Definitive Guide) related to JavaScript, and it had three sections as

"Client-Side JavaScript",
"Server-side JavaScript"
"CoreJavaScript"

It fails to explain the difference or I could not find it. Can someone please explain the below:

Are they differ in anything other than the usage ? or Does the syntax and definitions also differ?

Also as discussing about the book, I started learning JavaScript with this book ( JavaScript:The Definitive Guide), Next I will move on to 'JavaScript:The Good Parts by Douglas, and then I will try to inspect code of some real websites. Please let me know if I am going in right path to master this language?

like image 263
Pradeep Avatar asked Aug 19 '26 22:08

Pradeep


2 Answers

Are they differ in anything other than the usage ? or Does the syntax and definitions also differ?

The language is the same. The environment is different.

By "Core JavaScript," Flanagan is talking about the language and only the objects and functions defined by the ECMAScript specification, leaving anything provided by the environment out.

By "Client-side JavaScript" he's talking about the use of JavaScript, the language, in a browser environemnt. In a browser environment, your code will have access to things provided by the browser, like the document object for the current page, the window, functions like alert that pop up a message, etc.

By "Server-side JavaScript" he's talking about the use of JavaScript, the language, in a server environment. In that environment, your code won't have access to browser-related things because, well, it's not in a browser. It'll probably have access to other things, like APIs for dealing with the file system, databases, network, etc.

like image 82
T.J. Crowder Avatar answered Aug 21 '26 11:08

T.J. Crowder


  • Server-sided: Runs on server (like Node.js)
  • Client-sided: Runs in browser
  • Core: The set of functionality available to all javascript engines
like image 35
Anders Bornholm Avatar answered Aug 21 '26 13:08

Anders Bornholm