ru
Feedback
Javascript Node Js basic to Advance

Javascript Node Js basic to Advance

Открыть в Telegram
1 176
Подписчики
Нет данных24 часа
-27 дней
-1130 день
Архив постов
// 11. Number.MAX_VALUE
console.log(Number.MAX_VALUE);

// 10. Number.MIN_VALUE
console.log(Number.MIN_VALUE);

// 9. Number.EPSILON
console.log(Number.EPSILON);

// 8. Number.MIN_SAFE_INTEGER
console.log(Number.MIN_SAFE_INTEGER);

// 7. Number.MAX_SAFE_INTEGER
console.log(Number.MAX_SAFE_INTEGER);

// 6. Number.isSafeInteger()
(async () => {
  let { input } = require("jsshort");
  let num = parseFloat(await input("Enter a number to check if it's a safe integer: "));
  console.log(Number.isSafeInteger(num));
})();

// 5. Number.isInteger()
(async () => {
  let { input } = require("jsshort");
  let num = parseFloat(await input("Enter a number to check if it's an integer: "));
  console.log(Number.isInteger(num));
})();

// 4. Number.isFinite()
(async () => {
  let { input } = require("jsshort");
  let num = parseFloat(await input("Enter a number to check if it's finite: "));
  console.log(Number.isFinite(num));
})();

// 3. Number.isNaN()
(async () => {
  let { input } = require("jsshort");
  let value = parseFloat(await input("Enter a value to check for NaN: "));
  console.log(Number.isNaN(value));
})();

// 2. Number.parseInt()
(async () => {
  let { input } = require("jsshort");
  let strInt = await input("Enter an integer: ");
  let radix = parseInt((await input("Enter the radix (optional): ")) || 10);
  console.log(Number.parseInt(strInt, radix));
})();

// 1. Number.parseFloat()
(async () => {
  let { input } = require("jsshort");
  let strFloat = await input("Enter a floating-point number: ");
  console.log(Number.parseFloat(strFloat));
})();

Numbers methods 👇

Object methods 👆

// 25. Object.getOwnPropertySymbols()
let sampleObject = { [Symbol('a')]: 'value' };
console.log(Object.getOwnPropertySymbols(sampleObject));
// Retrieves an array of all symbol properties found directly upon a given object

// 24. Object.isFrozen()
let sampleObject = { name: 'John', age: 30 };
console.log(Object.isFrozen(sampleObject));
// Checks if an object is frozen or not

// 23. Object.isSealed()
let sampleObject = { name: 'John', age: 30 };
console.log(Object.isSealed(sampleObject));
// Checks if an object is sealed or not

// 22. Object.isExtensible()
let sampleObject = { name: 'John', age: 30 };
console.log(Object.isExtensible(sampleObject));
// Checks if an object is extensible or not

// 21. Object.preventExtensions()
let sampleObject = { name: 'John', age: 30 };
Object.preventExtensions(sampleObject);
// Prevents adding new properties to an object

// 20. Object.keys()
let sampleObject = { a: 'Apple', b: 'Ball', c: 'Cat' };
let keys = Object.keys(sampleObject);
console.log(keys);

// 19. Object.values()
let sampleObject = { a: 'Apple', b: 'Ball', c: 'Cat' };
let values = Object.values(sampleObject);
console.log(values);