I was just wondering if jQuery can be considered as a language, since it has its own syntax. I can't say it's a library, because most other languages are made through a library of another language. For example, PHP is written in C and PHP functions call functions made in C.
Just wanted to hear ideas and insights from all of you.
It doesn't have its own syntax, it's simply plain JavaScript.
They implement a fluent interface pattern, that basically allows you to chain function calls, e.g.:
$(argument).method1().method2(); // etc...
$
is allowed to be used as an Identifier, that's why many libraries use it, not just jQuery.
In the above example, the $
identifier is in the context of a call expression, $(arguments)
is just similar to myFunction(argument)
, that function call returns an object, that contains other properties that are by itself methods, that can be called subsequently as a "chain".
An example of a language built on top JavaScript (something slightly similar to your C => PHP example) would be CoffeeScript.
It's a javascript library. So i'd say no. Javascript is the language.
No, jQuery is a JavaScript library. It doesn't have its own syntax, but rather (as Jason said) a set of conventions for using JavaScript syntax.
PHP is a language with a runtime written in C. PHP code is obviously not C code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With