Javascript Node Js basic to Advance
1.09K subscribers
4 photos
1 video
2 files
39 links
Javascript Node Js group

@LogicB_Support
@BCA_MCA_BTECH
Download Telegram
// 16. Number.prototype.toString()
(async () => {
let { input } = require("jsshort");
let num = parseFloat(await input("Enter a number: "));
let radix = parseInt(await input("Enter the radix (optional): "));
console.log(num.toString(radix));
})();
// 17. Number.prototype.valueOf()
(async () => {
let { input } = require("jsshort");
let num = parseFloat(await input("Enter a number: "));
console.log(num.valueOf());
})();
// 18. Number.prototype.toLocaleString()
(async () => {
let { input } = require("jsshort");
let num = parseFloat(await input("Enter a number: "));
let locales = await input("Enter locales (optional): ");
let options = { style: 'currency', currency: 'USD' };
console.log(num.toLocaleString(locales, options));
})();
Numbers methods 👆
Now it's discussion group is public you can ask any questions or discuss at any topic

@Nodejs_group_pro

Hindi / English
// fibonacci series by js

function fibonacci(num) {

if (num == 1)
return 0;

if (num == 2)
return 1;

let num1 = 0;
let num2 = 1;
let sum;
let i = 2;

while (i < num) {
sum = num1 + num2;
num1 = num2;
num2 = sum;
i += 1;
}

return num2;
}


console.log("Fibonacci(5): " + fibonacci(5));

console.log("Fibonacci(8): " + fibonacci(8));
👍1
// currySum
function sum(a, b, c) {
return a + b + c;
}

let curry = fn => (a => (b => (c => fn(a, b, c))));

let currySum = curry(sum);
console.log(currySum(1)(2)(3));
👍1👎1
Everything related to coding 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
👍2
Apna khud ka Compiler bot run karna ab bahut simple hai

Bas iocompiler lib install karo aur code run kardo 👇ye dekho poori details

https://t.me/logicBots/207
// Api to fetch states of india

const statesURL = 'https://cdn-api.co-vin.in/api/v2/admin/location/states';

require("axios").get(statesURL)
.then(response => {
const states = response.data.states;
console.log('States:', states);
})
.catch(error => {
console.error('Error fetching states:', error.message);
});
// Api to fetch district of states of india

// at last 34 is up state's id to fetch district of up

const statesURL = 'https://cdn-api.co-vin.in/api/v2/admin/location/districts/34';

require("axios").get(statesURL)
.then(response => {
const states = response.data.states;
console.log('States:', states);
})
.catch(error => {
console.error('Error fetching states:', error.message);
});
for(i = 0 ; i < 5; i++){
setTimeout(res=>console.log(i), 0)
}
Output of this code ?

const a = "my name is not x"; console.log(a.split().join(", "))
Anonymous Quiz
35%
m, y, , n, a, m, e, , i, s, , n, o, t, , x
28%
my name is not x
12%
error
25%
my, name, is, not, x
Expert React developer message me @Panditsiddharth
If you want learn js for website development 👇join it
@react_next_js

For any problems in js site development feel free to ask questions 😊👇
@reactjs_nextjs_group
What will be answer and why ?
console.log( {"sid":1} == {"sid":1} )
Anonymous Quiz
40%
true
22%
false
22%
error
16%
undefined
👍2