From 32c6f41b43f51e8d343263b9f313160a3003aa29 Mon Sep 17 00:00:00 2001 From: tejanayak12 <118418860+tejanayak12@users.noreply.github.com> Date: Fri, 3 Mar 2023 10:39:31 +0530 Subject: [PATCH 1/3] operateros added --- 1-Javascript Fundamentals/code/operators.js | 47 +++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/1-Javascript Fundamentals/code/operators.js b/1-Javascript Fundamentals/code/operators.js index e69de29..6b27788 100644 --- a/1-Javascript Fundamentals/code/operators.js +++ b/1-Javascript Fundamentals/code/operators.js @@ -0,0 +1,47 @@ + +//ARTHAMATIC OPERATIONS>>>>>>>> +5+2 // 7 addition; + +5-1 // 4 subraction; + +2*2 // 4 multiply; + +54 % 5 // 4 modula; + +5/4 // 1.25 // division; + +//STRING OPERATIONS>>>>>>>>>>>> + +'teja ' + 'nayak' // teja nayak + +"teja" + "nayak" // tejanayak + +//NAN OPERATIONS>>>>>>>>>>>>>>>> +NaN == NaN // false; + +NaN === NaN // false // NaN Stands for (Not A Number); + +'Teja' * 'Nayak' // NaN; + +Number.isNaN (1000) // false; + +Number.isNaN (NaN) // true; + +Number.isNaN ('teja') // false; + +Number.isNaN (45*65) // false; + +Number.isNaN (true) // false; + +Number.isNaN (false) // false; + +'5' + 5 // '55'; + +'5'+'5' //'55'; + +String (45+45) //'90' + +Number (45+45) //'90'; + +String (45+45) //'90' + From 9a921e611489cf0973927366981584d3900da74b Mon Sep 17 00:00:00 2001 From: tejanayak12 <118418860+tejanayak12@users.noreply.github.com> Date: Fri, 17 Mar 2023 11:26:36 +0530 Subject: [PATCH 2/3] functtion added --- ...r-return-function-arthamatic-operations.js | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 2-Javascript-Functions/1.High-order-return-function-arthamatic-operations.js diff --git a/2-Javascript-Functions/1.High-order-return-function-arthamatic-operations.js b/2-Javascript-Functions/1.High-order-return-function-arthamatic-operations.js new file mode 100644 index 0000000..a6f0017 --- /dev/null +++ b/2-Javascript-Functions/1.High-order-return-function-arthamatic-operations.js @@ -0,0 +1,45 @@ +function arthamaticopeartions(operations){ + if(operations === '+'){ + return function(a,b){ + return a+b; + } + }else if(operations === '-'){ + return function(a,b){ + return a-b; + } + }else if(operations === '*'){ + return function(a,b){ + return a*b; + } + }else if(operations === '/'){ + return function(a,b){ + return a/b; + } + }else if(operations === '%'){ + return function(a,b){ + return a%b; + } + }else return function(a,b){ + return 0; + } +}; + +const addfunction = arthamaticopeartions('+'); +const multiplyfunction = arthamaticopeartions('*'); +const subractfunction = arthamaticopeartions('-'); +const divisionfunction = arthamaticopeartions('/'); +const modulefunction = arthamaticopeartions('%'); + +const result1 = addfunction(85,960);//1045 +const result2 = multiplyfunction(852,963);//820476 +const result3 = subractfunction(852,963);//-111 +const result4 = divisionfunction(852,963);//0.8847352024922118 +const result5 = modulefunction(852,963);//852 + +console.log(result1); +console.log(result2); +console.log(result3); +console.log(result4); +console.log(result5); + + From 667b0ca6c5f0586a13cd600046e60cd058906fb2 Mon Sep 17 00:00:00 2001 From: tejanayak12 <118418860+tejanayak12@users.noreply.github.com> Date: Fri, 17 Mar 2023 12:50:14 +0530 Subject: [PATCH 3/3] Changes-Added --- ...r-return-function-arthamatic-operations.js | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/2-Javascript-Functions/1.High-order-return-function-arthamatic-operations.js b/2-Javascript-Functions/1.High-order-return-function-arthamatic-operations.js index a6f0017..c9f7684 100644 --- a/2-Javascript-Functions/1.High-order-return-function-arthamatic-operations.js +++ b/2-Javascript-Functions/1.High-order-return-function-arthamatic-operations.js @@ -1,21 +1,21 @@ -function arthamaticopeartions(operations){ - if(operations === '+'){ +function arithmeticOpeartions(operation){ + if(operation === '+'){ return function(a,b){ return a+b; } - }else if(operations === '-'){ + }else if(operation === '-'){ return function(a,b){ return a-b; } - }else if(operations === '*'){ + }else if(operation === '*'){ return function(a,b){ return a*b; } - }else if(operations === '/'){ + }else if(operation === '/'){ return function(a,b){ return a/b; } - }else if(operations === '%'){ + }else if(operation === '%'){ return function(a,b){ return a%b; } @@ -24,13 +24,13 @@ function arthamaticopeartions(operations){ } }; -const addfunction = arthamaticopeartions('+'); -const multiplyfunction = arthamaticopeartions('*'); -const subractfunction = arthamaticopeartions('-'); -const divisionfunction = arthamaticopeartions('/'); -const modulefunction = arthamaticopeartions('%'); +const addfunction = arithmeticOpeartions('+'); +const multiplyfunction = arithmeticOpeartions('*'); +const subractfunction = arithmeticOpeartions('-'); +const divisionfunction = arithmeticOpeartions('/'); +const modulefunction = arithmeticOpeartions('%'); -const result1 = addfunction(85,960);//1045 +const result1 = addfunctionarithmeticOpeartions(85,960);//1045 const result2 = multiplyfunction(852,963);//820476 const result3 = subractfunction(852,963);//-111 const result4 = divisionfunction(852,963);//0.8847352024922118