Welcome ! HomeForums
Login Register

Forums Home| Sms Zone
ওয়েবসাইট তৈরি করতে ক্লিক করুন
Write New Thread

Forums.Likebd.Com > বাংলা ফোরামস > কোডিং > JavaScript > জাভাস্ক্রিপ্ট

জাভাস্ক্রিপ্ট

Facebook Twitter Googleplus Pint Views: 1875
Thread Rating:
0 Vote(s) - 0 Average 1 2 3 4 5
(01-09-2017, 11:44 PM ) width= Hasan [ 1 ]
জাভাস্ক্রিপ্টইন্টারনেটে ব্যবহৃত সবচেয়ে জনপ্রিয় স্ক্রিপ্টিং ল্যাংগুয়েজ। জাভাস্ক্রিপ্ট হল একটি ক্লায়েন্ট সাইড স্ক্রিপ্টিং ল্যাংগুয়েজ বা ব্রাউজার স্ক্রিপ্টিং। জাভাস্ক্রিপ্ট (কখনও কখনও সংক্ষিপ্ত JS) একটি প্রোটোটাইপ-ভিত্তিক স্ক্রিপ্টিং ল্যাংগুয়েজ যাতে পরিবর্তনশীল, দুর্বল টাইপ এবং প্রথম শ্রেণীর ফাংশন আছে। এটি একটি অবজেক্ট ওরিয়েন্টেড, কার্যকরী প্রোগ্রামিং শৈলী সমর্থনকারী। জাভাস্ক্রিপ্ট একটি ওবজেক্ট-ওরিয়েন্টেড, ডায়নামিক প্রোগ্রামিং ভাষা। এতে আছে ডেটা টাইপ, অপারেটর, গুরুত্বপূর্ণ কিছু অবজেক্ট (যেগুলো সব সময় আপনি ব্যবহার করতে পারবেন) আর ফাংশন বা মেথড। জাভা আর সি প্রোগ্রামিং ভাষা থেকে বেশ কিছু সিন্ট্যাক্স ধার করে নেওয়ায় যারা এসব ভাষায় পারদর্শী তাদের জন্য সুখবর । [৩]

ইতিহাস

১৯৯৫ সালে নেটস্কেপের প্রকৌশলী ব্রেন্ডন আইক জাভাস্ক্রিপ্ট তৈরি করেন, যেটা মুক্তি পায় ১৯৯৬ সালের শুরুর দিকে নেটস্কেপ ২ (ব্রাউজার) এর সাথে। এর নাম দেয়া হয়েছিল LiveScript, কিন্তু মার্কেটিং কৌশলের গ্যাড়াকলে পড়ে দুর্ভাগ্যজনত এর নাম জাভাস্ক্রিপ্ট হয়ে যায়, সান মাইক্রোসিস্টেম এর জাভা ল্যাংগুয়েজের জনপ্রিয়তাকে পুঁজি করার জন্য। জাভা আর জাভাস্ক্রিপ্টের মাঝে তেমন কোন মিল না থাকা সত্ত্বেও সেই থেকে তাই জাভাস্ক্রিপ্ট নামটা নিয়ে বিভ্রান্তি থেকে গেছে। মাইক্রোসফট এই প্রোগ্রামিং ভাষার সাথে প্রায় মিলে যায় এরকম একটি ল্যাংগুয়েজ JScript নাম দিয়ে প্রায় ৩ মাস পর ইন্টারনেট এক্সপ্লোরারের সাথে বাজারে নিয়ে আসে। এদিকে নেটস্কেপ Ecma International (স্ট্যান্ডার্ড নির্ধারণ করে এরকম একটি ইউরোপীয়ান সংস্থা) এর কাছে ল্যাংগুয়েজটি উপস্থাপন করে - যার ফলাফল ১৯৯৭ সালে ECMAScript এর প্রথম সংস্করণ হিসেবে বাজারে আসে। ১৯৯৯ সালে এই স্ট্যান্ডার্ডটি আরো উন্নত হয় ECMAScript সংস্করণ ৩ হিসেবে - আর সেই থেকে ভাষাটির তেমন কোন বড় পরিবর্তন হয়নি। চতুর্থ সংস্করণটি ভেস্তে যায়, ভাষাটির জটিলতা নিয়ে মতবিরোধের ফলাফল হিসেবে। তবে এই চতুর্থ সংস্করণের অনেক অংশবিশেষ কে ভিত্তি হিসেবে ধরে ২০০৯ সালে নতুন ECMAScript এর পঞ্চম সংস্করণ প্রকাশ করা হয়।[৪] when it was deployed in the Netscape Navigator 2.0 beta 3 in December.[৫]

ভাষার ধরন

সাধারন উদাহরণ
জাভাস্ক্রিপ্ট এ ভেরিয়েবল ডিক্লায়ার করা হয় var কি ওয়ার্ড দিয়ে :[৬]

var x; // defines the variable x and assigns to it the special value "undefined" (not to be confused with an undefined value)
var y = 2; // defines the variable y and assigns to it the value 2
এই ভাষায় কমেন্ট লিখা হয় ২টা স্ল্যাশ এর মাধ্যমে (//) । যেটা উপরে দেখতে পাচ্ছেন ।

এর কোন বিল্ড ইন ফাংশান নাই ; রান টাইম ইনভাইরন মেন্ট এটা প্রদান করে থাকে . The ECMAScript এর ৫ম এডিশনে বলা হয়েছে:[৭]

… এখানে কোন প্রভিশনের প্রয়োজন নাই । ডাটা স্ফেকিশনের জন্য .

যদিও অধিকাংশেরকনসল অবজেক্ট থাকে [৮] যা দ্বারা সে এর আউটপুট দেখতে পারে :

console.log("Hello World!");
জাভাস্ক্রিপ্ট এর একটা সিম্পল ফাংশন:

functionfactorial(n){if(n===0||n===1)return1;//fact0=fact1=1returnn*factorial(n-1)}factorial(3);// returns 6
একটা এনোনমাস ফাংশন :

functioncounter(){varcount=0;returnfunction(){return++count}};varclosure=counter();closure();// returns 1closure();// returns 2closure();// returns 3
[৯]

functionsum(){varx=0;for(vari=0;i<arguments.length;++i)x+=arguments[i];returnx}sum(1,2);// returns 3sum(1,2,3);// returns 6
varcounter=(function(){vari=0;// private propertyreturn{// public methodsget:function(){alert(i);},set:function(value){i=value;},increment:function(){alert(++i);}};})();// modulecounter.get();// shows 0counter.set(6);counter.increment();// shows 7counter.increment();// shows 8
আরো এডফান্সড উদাহরণ
এই সাধারন কোড জাভাস্ক্রিপ্ট এর বিভিন্য উদাহরণ প্রকাশ করে । .

/* Finds the lowest common multiple (LCM) of two numbers */functionLCMCalculator(x,y){// constructor functionvarcheckInt=function(x){// inner functionif(x%1!==0){thrownewTypeError(x+" is not an integer");// throw an exception}returnx;};this.a=checkInt(x)// semicolons ^^^^ are optional, a newline is enoughthis.b=checkInt(y);}// The prototype of object instances created by a constructor is// that constructor's "prototype" property.LCMCalculator.prototype={// object literalconstructor:LCMCalculator,// when reassigning a prototype, set the constructor property appropriatelygcd:function(){// method that calculates the greatest common divisor// Euclidean algorithm:vara=Math.abs(this.a),b=Math.abs(this.b),t;if(a<b){// swap variablest=b;b=a;a=t;}while(b!==0){t=b;b=a%b;a=t;}// Only need to calculate GCD once, so "redefine" this method.// (Actually not redefinition—it's defined on the instance itself,// so that this.gcd refers to this "redefinition" instead of LCMCalculator.prototype.gcd.// Note that this leads to a wrong result if the LCMCalculator object members "a" and/or "b" are altered afterwards.)// Also, 'gcd' === "gcd", this['gcd'] === this.gcdthis['gcd']=function(){returna;};returna;},// Object property names can be specified by strings delimited by double (") or single (') quotes.lcm:function(){// Variable names don't collide with object properties, e.g., |lcm| is not |this.lcm|.// not using |this.a*this.b| to avoid FP precision issuesvarlcm=this.a/this.gcd()*this.b;// Only need to calculate lcm once, so "redefine" this method.this.lcm=function(){returnlcm;};returnlcm;},toString:function(){return"LCMCalculator: a = "+this.a+", b = "+this.b;}};// একটা আউটপুট ফাংশন; এই প্রয়োগ সুধুমাত্র ওয়েব ব্রাওজারে কাজ করবে । functionoutput(x){document.body.appendChild(document.createTextNode(x));document.body.appendChild(document.createElement('br'));}// Note: Array's map() and forEach() are defined in JavaScript 1.6.// They are used here to demonstrate JavaScript's inherent functional nature.[[25,55],[21,56],[22,58],[28,56]].map(function(pair){// array literal + mapping functionreturnnewLCMCalculator(pair[0],pair[1]);}).sort((a,b)=>a.lcm()-b.lcm())// sort with this comparative function; => is a shorthand form of a function, called "arrow function".forEach(printResult);functionprintResult(obj){output(obj+", gcd = "+obj.gcd()+", lcm = "+obj.lcm());}
নিচের উদাহরনটা ওয়েব ব্রাউজারে প্রদর্শন করবে ।

LCMCalculator: a = 28, b = 56, gcd = 28, lcm = 56
LCMCalculator: a = 21, b = 56, gcd = 7, lcm = 168
LCMCalculator: a = 25, b = 55, gcd = 5, lcm = 275
LCMCalculator: a = 22, b = 58, gcd = 2, lcm = 638
Quote
(01-09-2017, 11:59 PM ) width= Test [ 0 ]
Oww Nice.
Quote
« Next Oldest | Next Newest »

You must Login for comment or Register here
Share Link
Link :
HTML Link:
BBcode Link:

Tag:

জাভাস্ক্রিপ্ট free net tips, জাভাস্ক্রিপ্ট Tips and Trick, জাভাস্ক্রিপ্ট Free download, জাভাস্ক্রিপ্ট jokes koutuk, জাভাস্ক্রিপ্ট hasir golpo, Funny golpo story 2015 2016 207, জাভাস্ক্রিপ্ট New tips, জাভাস্ক্রিপ্ট all Golpo story fun jokes,জাভাস্ক্রিপ্ট wapka wml xhtml code css

Possibly Related Threads…
  [Code] তৈরি করুন javascript Random image লিংক
  এবার জাভা ফোনেও পিসির মতো Refresh ব্যবহার করুন,আর ফোনকে রাখুবন ফাস্ট


  • Subscribe to this thread


EasyMenu
Create Post:
Forum Jump:
Main Category
Bangla Sms বাংলা এসএমএস
English Sms বিজ্ঞান-ও-প্রযুক্তি
ইসলামের কথা খবরা-খবর
বিনোদন ডেস্ক খেলাধুলার খবর
দৈনন্দিন জীবন টিপস এবং ট্রিক
রিভিউ সমগ গল্প সমগ্র
কবিতা সমগ্র অপরেটর নিউজ
বিশেষ আয়োজন গানের কথা
অন্যান্য ও মজা বাংলা কৌতুক
জানা ও অজানা পড়াশোনা
চাকুরির বিজ্ঞপ্তি Web-Development
Return to Top Forums.Likebd.com :: Bangladesh First Forums and Community Place
Switch to Desktop Version
Back To : Likebd.com