Introduction (परिचय)

Computers are common in today's world, as they are able to perform a wide variety of tasks quickly and accurately. They are used in many different industries, such as business, healthcare, education, and entertainment, and have become an essential part of daily life for many people. Besides this, they are also used to perform complex scientific and mathematical calculations, to store and process large amounts of data, and to communicate with people around the world.

कम्प्युटरहरू आजको संसारमा सामान्य छन्, किनकि तिनीहरूले विभिन्न प्रकारका कार्यहरू छिटो र सही रूपमा गर्न सक्षम छन्। तिनीहरू विभिन्न उद्योगहरू, जस्तै व्यवसाय, स्वास्थ्य सेवा, शिक्षा र मनोरन्जन, र धेरै व्यक्तिहरूको लागि दैनिक जीवनको आवश्यक हिस्सा भएको छ। यस बाहेक, तिनीहरू जटिल वैज्ञानिक र गणितीय गणनाहरू प्रदर्शन गर्न, ठूला मात्रामा डाटा भण्डार गर्न र प्रक्रिया गर्न, र विश्वभरका मानिसहरूसँग कुराकानी गर्न सक्छन।

Programming involves creating a set of instructions, called a program, for a computer to follow. It can be tedious and frustrating at times because computers are very precise and need specific instructions in order to complete tasks.

प्रोग्रामिंगले निर्देशनहरूको सेट सिर्जना गर्दछ । जसलाई प्रोग्राम भनिन्छ र यो कम्प्युटरको अनुसरण गर्नको लागि लेखिन्छ । यो लेखन कार्य कहिलेकाहीं थकित र निराशाजनक हुन सक्छ किनभने कम्प्युटरहरू धेरै सटीक छन् र कार्यहरू पूरा गर्न विशिष्ट निर्देशनहरू आवश्यक पर्दछ।

Intro Page

Programming languages are artificial languages used to give instructions to computers. They are used in most programming tasks and are based on the way humans communicate with each other. Like human languages, programming languages allow words and phrases to be combined to express new concepts. It is interesting to note that the most effective way to communicate with computers involves using a language that is similar to human language.

प्रोग्रामिंग भाषाहरू कम्प्युटरलाई निर्देशन दिन कृत्रिम भाषाहरू हुन्। तिनीहरू प्राय: प्रोग्रामिंग कार्यहरूमा प्रयोग गरिन्छ र व्यक्तिहरूले एक अर्कासँग कुराकानी गर्ने तरीकामा आधारित छन्। मानवीय भाषाहरूले जस्तै प्रोग्रामिंग भाषाहरू नयाँ अवधारणाहरू व्यक्त गर्न शब्दहरू र वाक्यांशहरू प्रदान गर्न अनुमति दिन्छन्। कम्प्युटरसँग कुराकानी गर्ने सबैभन्दा प्रभावकारी तरिका भनेको मानव भाषासँग मिल्दोजुल्दो भाषा प्रयोग गर्नु हो र यो निकै नै चाखलाग्दो विषय छ।

In the past, the primary way to interact with computers was through language-based interfaces like BASIC and DOS prompts. These have been largely replaced by visual interfaces, which are easier to learn but offer less flexibility. However, computer languages like JavaScript are still in use and can be found in modern web browsers and on most devices.

विगतमा कम्प्युटरसँग अन्तर्क्रियाको प्राथमिक मार्ग बेसिक र डस प्रोम्प्टहरू जस्ता भाषा-आधारित ईन्टरफेसहरू मार्फत थियो। यी धेरैजसो दृश्य इन्टरफेस द्वारा प्रतिस्थापित गरिएको छ, जुन सिक्न सजिलो हुन्छ तर कम लचिलोपन प्रस्ताव गर्दछ। तथापि, जाभास्क्रिप्ट जस्ता कम्प्युटर भाषाहरू अझै पनि प्रयोगमा छन् र आधुनिक वेब ब्राउजरहरू र अधिकांश उपकरणहरूमा फेला पार्न सकिन्छ।

JavaScript (JS for short) is the programming language that is used to create dynamic interaction while developing webpages, games, applications, and even servers.JavaScript started at Netscape, a web browser developed in the 1990s, and is today one of the most famous and used programming languages.

जाभास्क्रिप्ट (JS) प्रोग्रामिंग भाषा हो जुन वेबपृष्ठहरू, खेलहरू, अनुप्रयोगहरू र सर्भरहरू विकास गर्दा गतिशील अन्तरक्रिया सिर्जना गर्न प्रयोग गरिन्छ। जाभास्क्रिप्ट नेटस्केपमा सुरु भएको थियो । नेटस्केप जुन १९९० को दशकमा विकसित वेब ब्राउजर हो, र आज जाभास्क्रिप्ट सबैभन्दा प्रसिद्ध र प्रयोग गरिएको प्रोग्रामिंग भाषाहरू मध्ये एक हो।

Initially, it was created for making webpages alive and was able to run on a browser only. Now, it runs on any device that supports the JavaScript engine. Standard objects such as Array, Date, and Math are available in JavaScript, as well as operators, control structures, and statements. Client-side JavaScript and Server-side JavaScript are the extended versions of Core JavaScript.

सुरुमा, यो वेबनिर्देशनहरू जीवित बनाउनका लागि सिर्जना गरिएको थियो र ब्राउजरमा मात्र चलाउन सक्षम थियो। अब, यो कुनै पनि उपकरणमा चल्छ जुन जाभास्क्रिप्ट इन्जिनलाई समर्थन गर्दछ। मानक वस्तुहरू जस्तै Array, Date, र Math उपलब्ध छ। साथै अपरेटरहरू, संरचना र बयानहरू नियन्त्रण पनि यसमा गर्नसकिन्छ। क्लाइन्ट-साइड जाभास्क्रिप्टसर्भर-साइड जाभास्क्रिप्ट, मूल जाभास्क्रिप्टको विस्तारित संस्करणहरू हुन्।

  • Client-side JavaScript enables the enhancement and manipulation of web pages and client browsers. Responses to user events such as mouse clicks, form input, and page navigation are some of its examples.

  • क्लाइन्ट-साइड जाभास्क्रिप्ट वेब पृष्ठहरू र ब्राउजरहरूको बृद्धि र हेरफेर सक्षम गर्दछ। प्रयोगकर्ता घटनाहरूको प्रतिक्रियाहरू जस्तै माउस क्लिकहरू, फारम इनपुट, र पृष्ठ नेभिगेसन यसका केही उदाहरणहरू हुन्।

  • Server-side JavaScript enables access to servers, databases, and file systems.

  • सर्भर-साइड जाभास्क्रिप्ट सर्भर, डाटाबेस, र फाइल प्रणालीमा पहुँच सक्षम गर्दछ।

JavaScript is an interpreted language. While running Javascript an interpreter interprets each line and runs it. The modern browser uses Just In Time (JIT) technology for compilation, which compiles JavaScript into executable bytecode.

जाभास्क्रिप्ट एक व्याख्या गरिएको भाषा हो। जाभास्क्रिप्ट चलाउँदा एक दुभाषियाले प्रत्येक रेखाको व्याख्या गर्दछ र यसलाई चलाउँदछ। आधुनिक ब्राउजरले संकलनका लागि जस्ट इन टाइम (JIT) टेक्नोलोजी प्रयोग गर्दछ, जसले जाभास्क्रिप्टलाई कार्यान्वयन योग्य बाइटकोडमा संकलन गर्दछ।

"LiveScript" was the initial name given to JavaScript. "लाइभस्क्रिप्ट" जाभास्क्रिप्टलाई दिइएको प्रारम्भिक नाम थियो।

This book is divided into three main parts. The first 14 chapters cover the JavaScript language. The following three chapters discuss how JavaScript is used to program web browsers. The final two chapters are miscellaneous, and exercises. Various important topics and cases related to JavaScript programming are described in the Miscellaneous chapter, which is followed exercises.

यस पुस्तकलाई तीन भागमा विभाजन गरिएको छ। पहिलो १४ अध्यायहरूले जाभास्क्रिप्ट भाषालाई समेट्छ। निम्न तीन अध्यायहरूले वेब ब्राउजरहरू प्रोग्राम गर्न जाभास्क्रिप्ट कसरी प्रयोग गरिन्छ भनेर छलफल गर्दछ। अन्तिम दुई अध्यायहरू विविध र अभ्यास छन्। जाभास्क्रिप्ट प्रोग्रामिंगसँग सम्बन्धित विभिन्न महत्त्वपूर्ण विषयहरू र केसहरू विविध अध्यायमा वर्णन गरिएको छ, जुन अभ्यासहरू पछ्याउँदछ।

Code, and what to do with it

कोड, र यसको साथ के गर्ने

Code is the written instructions that make up a program. Many chapters in this book contain a lot of code, and it is important to read and write code as part of learning how to program. You should not just quickly scan the examples - read them carefully and try to understand them. This may be difficult at first, but with practice, you will improve. The same goes for the exercises - make sure you actually try to write a solution before assuming you understand them. It is also helpful to try running your solutions to the exercises in a JavaScript interpreter, as this will allow you to see if your code is working correctly and may encourage you to experiment and go beyond the exercises.

कोड लिखित निर्देशन हो जसले प्रोग्राम बनाउँदछ। यस पुस्तकका धेरै अध्यायहरूमा धेरै कोडहरू छन्, र कसरी प्रोग्राम गर्ने भनेर सिक्ने भागको रूपमा कोड पढ्न र लेख्न महत्त्वपूर्ण छ। तपाईंले उदाहरणहरू तुरुन्तै स्क्यान गर्नुहुँदैन - तिनीहरूलाई ध्यानपूर्वक पढ्नुहोस् र तिनीहरूलाई बुझ्ने प्रयास गर्नुहोस्। यो सुरुमा गाह्रो हुन सक्छ, तर अभ्यासको साथ, तपाईं सुधार हुनेछ। व्यायामको लागि पनि त्यस्तै हुन्छ - सुनिश्चित गर्नुहोस् कि तपाईं वास्तवमा तिनीहरूलाई बुझ्नु अघि समाधान लेख्ने प्रयास गर्नुहुन्छ। यो जाभास्क्रिप्ट दुभाषियामा अभ्यासहरूको लागि तपाईंको समाधानहरू चलाउन प्रयास गर्न पनि उपयोगी छ, किनकि यसले तपाईंलाई तपाईंको कोडले सही तरिकाले काम गरिरहेको छ कि छैन भनेर हेर्न अनुमति दिन्छ र तपाईंलाई प्रयोग गर्न र अभ्यासहरू भन्दा बाहिर जान प्रोत्साहित गर्न सक्छ।

Typographic conventions

टाइपोग्राफिक कन्भेन्सनहरू

In this book, text written in a monospaced font represents elements of a program. This can be a self-contained fragment or a reference to part of a nearby program. Programs, like the one shown below, are written in this way:

यस पुस्तकमा एक मोनोस्पेड फन्टमा लेखिएका पाठले प्रोग्राम को तत्वहरू प्रतिनिधित्व गर्दछ। यो एक स्व-निहित अंश वा नजिकैको प्रोग्राम को अंशको सन्दर्भ हुन सक्छ। एउटा उदाहरण तल देखाइएको छ।

const numbers = [45, 4, 9, 16, 25];
let txt = "";
for (let x in numbers) {
  txt += numbers[x];
}

Sometimes, the expected output of a program is written after it, preceded by two slashes with a Result, like this:

कहिलेकाँही, प्रोग्राम को अपेक्षित आउटपुट यो पछि लेखिएको हुन्छ, दुई स्ल्याश द्वारा, जस्तै:

console.log(txt);

// Result: txt = '45491625'

Good Luck! 🍀

शुभकामना! 🍀

results matching ""

    No results matching ""