{"id":24438731,"url":"https://github.com/anower77/javascript_basic-sl-","last_synced_at":"2025-03-14T00:13:16.993Z","repository":{"id":185242768,"uuid":"559730241","full_name":"Anower77/JavaScript_Basic-SL-","owner":"Anower77","description":" Basic Syntax Of JavaScript- [ Console.log- Datatype- date - do-while-loop - If_condition - else_condition - elseif_condition - escapnotation - Logical_operator - Math - String - String_length - String_Method - Switch - Ternary - Variable - While_loop ]","archived":false,"fork":false,"pushed_at":"2022-10-31T01:33:52.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T19:17:34.295Z","etag":null,"topics":["basic","basic-javascript","javascript","math","oop","programming"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anower77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-10-31T01:03:49.000Z","updated_at":"2023-02-18T08:43:36.000Z","dependencies_parsed_at":"2023-08-01T08:03:15.939Z","dependency_job_id":null,"html_url":"https://github.com/Anower77/JavaScript_Basic-SL-","commit_stats":null,"previous_names":["anower77/javascript_basic-sl-"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anower77%2FJavaScript_Basic-SL-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anower77%2FJavaScript_Basic-SL-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anower77%2FJavaScript_Basic-SL-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anower77%2FJavaScript_Basic-SL-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anower77","download_url":"https://codeload.github.com/Anower77/JavaScript_Basic-SL-/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243500798,"owners_count":20300774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic","basic-javascript","javascript","math","oop","programming"],"created_at":"2025-01-20T19:17:37.452Z","updated_at":"2025-03-14T00:13:16.776Z","avatar_url":"https://github.com/Anower77.png","language":"JavaScript","readme":"# JavaScript Basic Syntax     \n\n## console.log\n```js\n    let persons = [\n    {Name : 'Anower', City : 'Feni', Roll : 45},\n    {Name : 'Rohan', City : 'Selyt', Roll : 35},\n    {Name : 'Shadat', City : 'Nepal', Roll : 57},\n    {Name : 'Shanto', City : 'Bogura', Roll : 46},\n    {Name : 'Nisan', City : 'Dhaka', Roll : 78}\n    ]\n\n    // console.log(persons)\n    console.table(persons)\n    console.warn(persons)\n    console.count(persons)\n    console.dir()\n    console.time()\n    console.timeEnd()\n    console.info()\n```\n\n\u003cbr/\u003e\n\n## Datatype\n```js\nprimitive\n\n1. Number\n//10, 4.5, 5, 6\n\n2. String\n'this is text' + \"this is also text\"\n\n3. Boolean\ntrue / false\n\n4. undefined\n\n5. null\n\nArray\n\nobject\n\n==========constractor==========\n\nBoolean()\nNumber()\nString()\n\n\nOperator\nIncremental\nPre Incremental - (++a) post Incremental - (a++)\nassingment operator \nlet a = 10\nlet b = 20\n\na += b\n\nconsole.log(a)\n\nlogical operator\n\u0026\u0026 ==\u003e true : true = true\n|| ==\u003e true : false = true\n! ==\u003e hole system always return nagetive vlaue\n\n\nlet a = 10\nlet b = 20\n\n// console.log(a = b)//false\n\nconsole.log(a == b)//false\n\nconsole.log(a \u003e b)// false\n\nconsole.log(a \u003c b)//true\n\nconsole.log(a \u003c= b)//true\nconsole.log(a \u003e= b)//false\n\nconsole.log(a != b)//true\n\nlet a = '20'\nlet b = 20\n\nconsole.log(a === b)\n\nconsole.log(a !== b)\n\nBitwise Operator\n\u0026\n|\n~\n^\n\u003c\u003c\n\u003e\u003e\n```\n\n\u003cbr/\u003e\n\n## date\n```js\n let date = new Date()\n\n console.log(date.toDateString())\n console.log(date.toTimeString())\n console.log(date.toLocaleString())\n\n console.log(date.getFullYear())\n console.log(date.getMonth())\n console.log(date.getDate())\n console.log(date.getHours())\n console.log(date.getMinutes())\n console.log(date.getSeconds())\n ```\n\n \u003cbr/\u003e\n\n## Do_While_Loop\n```js\n //Do while loop=======\n\nlet isRunning = false\n\n\nwhile (isRunning){\n    console.log(\"Anower Hossina\")\n}//false\n\n\ndo {\n    console.log(\"Anower hossain\")\n}//first time it's return a true\nwhile (isRunning)\n ```\n\n\n## if_condition\n\n```js\nlet a = 10\nlet b = 20\n\n//if condition true false\n\nif (a \u003e b){\n    console.log('A is greater then B')\n}\n\nif (a \u003c b){\n    console.log('B is greater then A')\n}\n\n\n//task find the even and odd number=====\n\nlet n = 50\n\n// if (n % 2 == 0){\n//     console.log(n + ' This is even Number')\n// }\n\n// if (n % 2 == 1){\n//     console.log(n + ' This is odd Number')\n// }\n```\n\n\n \u003cbr/\u003e\n\n## else_condition\n ```js\nlet a = 10\nlet b = 20\n\n//if condition true false\n\nif (a \u003e b){\n    console.log('A is greater then B')\n}else{\n    console.log('B is greater then A')\n}\n\n\n//task find the even and odd number=====\n\nlet n = 50\n\nif (n % 2 == 0){\n    console.log(n + ' This is even Number')\n}else{//(n % 2 == 1)\n    console.log(n + ' This is odd Number')\n}\n\n ```\n\n \u003cbr/\u003e\n\n ## else_if_condition\n\n ```js\nlet a = 20\nlet b = 20\n\n//if condition true false\n\nif (a \u003e b){\n    console.log('A is greater then B')\n}else if (a \u003c b){\n    console.log('B is greater then A')\n}else{\n    console.log('They both are same')\n}\n\n\n//task find the even and odd number=====\n\nlet n = 0\n\nif(n == 0){\n    console.log(n + ' is Zero')\n}else if (n % 2 == 0){\n    console.log(n + ' This is even Number')\n}else{\n    console.log(n + ' This is odd Number')\n}\n ```\n\n ## Escapnotation\n\n ```js\n// ****** Most Improtent Escape Notation\n\nlet str1 = \" My name is 'Anower'\"  //qutation 1st way\nlet str2 = \" My name is \\'Anower\\'\"//qutation 2nd way\nlet str3 = \" My name is \\tAnower\"  //tab \nlet str4 = \" My name is \\nAnower\"  //new line\nlet str5 = \" My name is \\\\Anower\"  // back shalsh(\\\\)\n\n// Extra Escape notation\nlet str7 = \" My name is \\rAnower\"  // Carrage return\nlet str8 = \" My name is \\bAnower\"  // Back speac\n\n\nconsole.log(str8)\n ```\n\n \u003cbr/\u003e\n \n ## Logical_Operator\n\n ```js\n// A \u0026\u0026 B\n// true \u0026\u0026 true = true\n// true \u0026\u0026 false = false\n// false \u0026\u0026 true = false\n// false \u0026\u0026 false =false\n\n\nlet a = 20\nlet b = 20\nlet c = 30\nlet d = 40\n\n\n// (\u0026\u0026) logical and opetator\nif (a \u003e b \u0026\u0026 c \u003e d){\n    console.log('A is greater then B and C is greater then D')\n}else{\n    console.log('At least one condition is false')\n}\n\n// A || B\n// true || true = true\n// true || false = true\n// false || true = true\n// false || false =false\n\n// (||) logical or opetator\nif (a \u003e b || c \u003e d){\n    console.log('A is greater then B or C is greater then D')\n}else{\n    console.log('At least one condition is false')\n}\n\n// (!) logical isnot opetator\n\nlet check = !(a \u003e b)\n\nconsole.log(check)\n ```\n\n ## Math\n\n ```js\n//Math program\n\nconsole.log(Math.E)//Exponential\n\nconsole.log(Math.PI)//Pia\n\nlet n = 4.589\n\nconsole.log(Math.abs(n))\nconsole.log(Math.floor(n))\nconsole.log(Math.ceil(n))\nconsole.log(Math.round(n))\n\nconsole.log(Math.max(400, 500, 600))\nconsole.log(Math.min(400, 500, 600))\n\nconsole.log(Math.pow(2, 3))\nconsole.log(Math.pow(5, 2))\nconsole.log(Math.sqrt(25))\nconsole.log(Math.sqrt(64))\n\n\n//random number generate========\n\nconsole.log(Math.round(Math.random() * 5 + 1))\n\n ```\n\n \u003cbr/\u003e\n\n ## String\n\n ```js\n// introduce to String\n\n// 'string' \"string\"\n// ['s', 't', 'r', 'i', 'n', 'g']\n\n\nlet str1 = 'something' // string literal\nlet str2 = String('something')// string constructor\n\n\n// Example to string\n\nlet n = 10\nlet num1 = n + ''       //1st way\nlet num2 = n.toString() //2nd way\nlet num3 = String(n)    //3rd way\n\nconsole.log(num3)\n\n ```\n\n \u003cbr/\u003e\n\n## String Comparison\n\n```js\n// string comparison\nlet a = 'abc'\nlet b = 'def'\n\nconsole.log(a \u003c b)\n\n// laxical comparison with string comparison\n\n\nconsole.log( 'a'  \u003e  'Z')//output true\n\nconsole.log( 'a' \u003c 'Z')// output false\n```\n\n\u003cbr/\u003e\n\n## String_Length\n\n```js\n// JS String length *****Heard ways******\n\nlet str = \"Anower Hossain\"\n\nlet length = 0\n\nwhile (true){\n\n    if (str.charAt(length) == \"\"){\n        break\n    }else{\n        length++\n    }\n\n}\n\nconsole.log(length)\n\n\n// JS String length *****Easy ways******\nlet str1 = \"Sanower Hossain\"\n\nconsole.log(str1.length)\nconsole.log('This is a speacial String  length method'.length)\n```\n\n\u003cbr/\u003e\n\n## String Method\n\n```js\n// JS String Methods=====\n\nlet a = 'I am'\nlet b = 'Anower Hossain'\n\nlet c = a.concat(' ', b)\n\n// console.log(c)\n\n// let d = c.substring(4, 11)\n// console.log(d)\n\n// console.log(c.charAt(3))\n\n// console.log(c.startsWith('I'))\n// console.log(c.endsWith(\"Hossain\"))\n// console.log(a.toUpperCase())\n// console.log(b.toLowerCase())\n\nconsole.log('       Extra_Speace_Remove         '/*.trim()*/)\nconsole.log(c.split(' '))\n\n```\n\n\u003cbr/\u003e\n\n## Switch Statement\n\n```js\n// 0- sunday, 1- monday, 3- tuesday\n\nlet date = new Date()\n\nlet today = date.getDay()\n\nswitch (today) {\n    case 0:\n        console.log('Today is sunday')\n        break\n    case 1:\n        console.log('Today is Monday')\n        break\n    case 2:\n        console.log('Today is Tuesday')\n        break\n    case 3:\n        console.log('Today is Wednesday')\n        break\n    case 4:\n        console.log('Today is Thursday')\n        break\n    case 5:\n        console.log('Today is Friday')\n        break\n    case 6:\n        console.log('Today is Saturday')\n        break\n    default: \n        console.log('Nor a value Number')\n}\n\n\n// find free and weekday for task (HW)\n\n// switch (new Date().getDay()) {\n//     case 6:\n//       console.log(\"Today is Saturday\")\n//       break;\n//     case 0:\n//       console.log(\"Today is Sunday\")\n//       break;\n//     default:\n//       console.log(\"Looking forward to the Weekend\")\n//   }\n\n\n// Referance to web ship =========\n\n// let amount = 400\n\n// switch (amount){\n//     case 100:\n//         console.log('That is 100')\n//         break\n//     case 200:\n//     case 300:\n//     case 400:\n//         console.log('That is 200 or 300 or 400')\n//         break\n//     default:\n//         console.log('Invalid Amount')\n// }\n\n\n```\n\n\u003cbr/\u003e\n\n## Ternary Operator\n\n```js\nlet n = 11\nlet str = ''\n\nif(n % 2 == 0){\n    str = \"EVEN Number\"\n}else{\n    str = \"ODD Number\"\n}\nconsole.log(str)\n\n// condition ? true side : false side\nlet result = (n % 2 == 0) ? \"EVEN\" : \"ODD\"\n\nconsole.log(result)\n\n\n// 27 class must be seen==\u003e\n\n```\n\n\u003cbr/\u003e\n\n## Variables\n\n```js\n//follow all instruction and read notes\n\nlet fullName = \"Anower hossain\"\n\nconsole.log(\"This is \" + fullName)\n```\n\n\u003cbr/\u003e\n\n## While_Loop\n\n```js\n// while loop======\u003e\n\nlet i = 0\n\nwhile (i \u003c= 5){\n    console.log(i + \". Anower Hossain\")\n    i++\n}\n\n\n//while project=====\n\n// let isRunning = true\n\n// while (isRunning){\n    \n//     let rand = Math.floor(Math.random() * 10 + 1)\n//     if(rand == 10){\n//         console.log(\"Winner Winner Chicken Dinner\")\n//         isRunning = false\n//     }else{\n//         console.log(\"Your have got \" + rand)\n//     }\n// }\n\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanower77%2Fjavascript_basic-sl-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanower77%2Fjavascript_basic-sl-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanower77%2Fjavascript_basic-sl-/lists"}