// 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));
})();Index:
Loops: https://t.me/nodejs_codes_pro/120
Lists ( Array ): https://t.me/nodejs_codes_pro/123
Strings: https://t.me/nodejs_codes_pro/148
Objects: https://t.me/nodejs_codes_pro/172
Numbers: https://t.me/nodejs_codes_pro/202
Why not joined coding channels and practice groups 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
Loops: https://t.me/nodejs_codes_pro/120
Lists ( Array ): https://t.me/nodejs_codes_pro/123
Strings: https://t.me/nodejs_codes_pro/148
Objects: https://t.me/nodejs_codes_pro/172
Numbers: https://t.me/nodejs_codes_pro/202
Why not joined coding channels and practice groups 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
🔥1😁1
Now it's discussion group is public you can ask any questions or discuss at any topic
@Nodejs_group_pro
Hindi / English
@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
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
Bas iocompiler lib install karo aur code run kardo 👇ye dekho poori details
https://t.me/logicBots/207
Create compiler bot in mobile
Run any language codes
In hindi:
Ab laptop ko kar do Tata bye bye gya 😂
https://youtu.be/352o8B9IikI?si=OSrhBU0mcFEkqILA
Run any language codes
In hindi:
Ab laptop ko kar do Tata bye bye gya 😂
https://youtu.be/352o8B9IikI?si=OSrhBU0mcFEkqILA
YouTube
How to create compiler bot and run c/c++ java python node js ts from mobile as server in termux
How to create compiler bot and run c/c++ java python node js ts from mobile as server in termux
Create own compiler bot in 2 minutes
Overview:
In this video, I exaplained You about how to use clone Compiler bot to create your own compiler bot.
keys:…
Create own compiler bot in 2 minutes
Overview:
In this video, I exaplained You about how to use clone Compiler bot to create your own compiler bot.
keys:…
// 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(", "))
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
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
@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} )
console.log( {"sid":1} == {"sid":1} )
Anonymous Quiz
40%
true
22%
false
22%
error
16%
undefined
👍2