Skip to content

Instantly share code, notes, and snippets.

View jaamaalxyz's full-sized avatar
🎯
Focusing

Md. Jamal Uddin jaamaalxyz

🎯
Focusing
View GitHub Profile
// declare an array with const
const arr = [1, 2, 3];
console.log(arr) // [1, 2, 3]
// try to re-decalre an array with the same name and cought an error
let arr = [2, 3, 4]; // SyntaxError: Identifier 'arr' has already been declared
// but you can change the value
arr.push(4);
console.log(arr); // [1, 2, 3, 4]

যারা নতুন ওয়েব ডেভেলপমেন্ট শিখতে চাচ্ছেন তাদের জন্য গাইডলাইন

✔ 1. একদম কিছু না জানলে আমাদের বেসিক টিউটোরিয়ালগুলো দেখুন। যেগুলোর লিংক: here

✔ 2. এরপর আপনাকে বুটস্ট্রাপ শিখতে হবে। এই জন্য আপনি প্রথমে w3schools থেকে বুটস্ট্রাপের বেসিক শিখুন।

✔ 3. তারপর বুটস্ট্রাপের ডকুমেন্টেশন পড়ে বুটস্ট্রাপের আরও বেশি শিখুন। মোটামুটি বুটস্ট্রাপ শেখার পরে আপনি ১৫০+ সেকশন কোর্সটি করার জন্য প্রস্তুত।

getting started️ 4. ১৫০+ সেকশন কোর্সটি: hereসাথে

const add = (x, y) => (+x) + (+y);
const subtract = (x, y) => (+x) - (+y);
const multiply = (x, y) => (+x) * (+y);
const divide = (x, y) => (+x) / (+y);
// Input validation function
const validateNumbers = (x, y) => {
if (isNaN(x) || isNaN(y)) {
return false;
}
const assert = require('assert');
const operations = require('./operations');
// Below test cases for input validation
it('indicates failure when a string is used instead of a number', () => {
assert.equal(operations.validateNumbers('beauty', 10), false)
});
it('indicates failure when two strings is used instead of numbers', () => {
assert.equal(operations.validateNumbers('Jamal', 'Beauty'), false)
// Number input validation function
const validateNumbers = (x, y) => {
if (isNaN(x) || isNaN(y)) {
return false;
}
return true;
}