Skip to main content

Featured

What is Coroutine in Android?

Coroutines are available for the Kotlin language. Coroutines are simply cooperative functions.   Our Android applications often have multiple concurrent and interdependent functionalities. We provide instructions to the system through code, also known as a program, to perform a set of sequential instructions.  During the execution of these instructions, a specific instruction may take longer than expected, causing the next line of code to wait until the previous line of code has completed its execution. This scenario is known as blocking program execution. To avoid blocking program execution, the code must be executed on a separate thread. A thread is a single sequential flow of control. However, creating and handling multiple threads can be difficult and expensive in terms of OS operations and memory usage. To address this issue, we can use Coroutines in Kotlin. Coroutines are cooperative functions that are executed on threads as needed in a cooperative manner. They help manage long-r

JavaScript : Get Started with JavaScript

 What is Javascript ?

JavaScript is the most popular and widespread programming language worldwide. It is the language of the web, running in every browser and enabling dynamic and interactive websites. In this blog post, we will learn what JavaScript is, why it is important, how to use it in web development, and some of its basic syntax and features.


For What purpose Javascript is used ?

JavaScript has evolved and expanded its capabilities to become a powerful and versatile language. It can be used for a variety of purposes, such as


- Front-end development: JavaScript, along with HTML and CSS, is the core technology for front-end web development. It can be used for user interface design, user interaction, and communication with web servers and APIs.


- Back-end development: JavaScript can also be used to create applications on the server side, using platforms such as Node.js, Express, and MongoDB. It can be used for request handling, data processing, and business logic.


- Full-stack development: JavaScript can be used to build full-stack web applications using frameworks like React, Angular, or Vue for front-end and Node.js, Express, or MongoDB for backend. This allows you to create a complete and coherent web app, from the user interface to the database.


- Mobile development: You can also build mobile apps with JavaScript. It can be used to create native-like applications that can run on both iOS and Android devices.


- Desktop development: JavaScript can also be used to build applications for the desktop by using frameworks such as Electron, NW.js, or Proton Native. You can use it to create cross-platform applications that can run on Windows, Mac, or Linux machines.


“Hello World” in Javascript


To write your first program in javascript you can use any code editor like VS Code or you can directly write javascript code in console of (Available in Developer tools) your any web browser.


Also you can write javascript code within a .html file as well. To add your code within and .html file you have to include your code within the <script>...</script> tag. You can refer to below example for the same :


Example :


<html>

<body>

  <p>Before the script...</p>

  <script>
    console.log( 'Hello, world!' );
  </script>

  <p>...After the script.</p>

</body>

</html>

The above program will print a ‘Hello, world!’ in console.


Congratulations you have succssfully written your first javascript code and which executed in the browser.


Comments

Popular Posts