DEV Community

Cover image for What is Javascript?
Manu Martinez
Manu Martinez

Posted on

What is Javascript?

I suppose it's your first time trying to read about how to code, unfortunately we will not talk about that. First of all you need to understand why JS is important and how to use JS in your daily routine.

When I started coding in JS, I realised that JS bring some new features and facilities than other languages, it's allow me to learn about algorithms and practice creating complex algorithms and run it easily with one command. Sincerely, I love JS and I usually use it when I want to learn using learning-by-doing paradigm. So, I strongly recommend you do the same as me, please you should love :).

Use cases
Javascript is a text-based programming language used both on the client-side and server-side that allows you to make web pages interactive. OMG!!! client & server side, you could think that JS is the unique programming language you need to know as a developer, but NO 🥲 , JS is like a tool which you will use to fulfill some requirements for a specific task. Then, what's exactly client & server side?

Client side
A dev beside a website,client side representation

JS is usually used to allow you make interactive and modern websites, you can create HTML and prepare actions for each HTML element, it's can be really amazing since you can detect click on buttons and make different actions trying to improve UX. Here, there is some example code:

// detect click on some button
button.addEventListener("click", (ev) => {
   // make here your actions to make web page interactive
Enter fullscreen mode Exit fullscreen mode

Server side
A mobile phone besides a server, server side representation

JS is usually used with Node JS to create the most complex API with different models and different types of DDBB, getting from SQL as MySQL until NO-SQL as MongoDB

// detect get request
app.get(`${basic_uri}/customers`, customerController.getCustomers);

// controller function, located in other file
const getCustomers = (req, res, next) => {
  //make query to ddbb
Enter fullscreen mode Exit fullscreen mode

As you can see above JS is a dynamic typed language, it's mean that data types are processing during execution time, so you will not worry about data types and how to use it. This is the reason why I really recommend JS as a first programming language since you can focus on algorithms and logic. Moreover, you have already seen that JS sintaxis is really clear and easier than other similar languages, maybe it's another reason to choose JS as a first programming language.

I hope you are enjoying reading the first post about JS, it's really important understand the use cases and how to work with JS. In the following posts we will talking about more exiting and difficult topics with more example code.

Top comments (2)

seremwen profile image

thank you

whitehatdevv profile image
Manu Martinez

you too for reading our post 😇