GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - parthakundu3/JavaScript: The goal of this repo is to save my js programs. Basics of JavaScript.🗽 🚀

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

133 Commits
133 Commits

Folders and files

NameName
Last commit message
Last commit date
01 - JavaScript-Basics
01 - JavaScript-Basics
 
 
05 - Objects-And-Functions
05 - Objects-And-Functions
 
 
Array
Array
 
 
Asynchronous-JavaScript
Asynchronous-JavaScript
 
 
BuildIn-Methods
BuildIn-Methods
 
 
Click-and-Drag
Click-and-Drag
 
 
DOM-Manipulation-And-Events
DOM-Manipulation-And-Events
 
 
ES10-or-ECMAScript2019
ES10-or-ECMAScript2019
 
 
ES7-or-ES2016
ES7-or-ES2016
 
 
HTTP Request
HTTP Request
 
 
How-JS-Works
How-JS-Works
 
 
Interview-Questions
Interview-Questions
 
 
Intro-To-ES6-Or-ES2015
Intro-To-ES6-Or-ES2015
 
 
Memory
Memory
 
 
OOP
OOP
 
 
Password-Generator
Password-Generator
 
 
Pattern
Pattern
 
 
Regex
Regex
 
 
algorithms
algorithms
 
 
drag-drop
drag-drop
 
 
jQuery
jQuery
 
 
js-coding-technique
js-coding-technique
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
README.md
README.md
 
 

Repository files navigation

JavaScript

JavaScript, often abbreviated as JS, is a programming language that conforms to the ECMAScript specification. JavaScript is high-level, often just-in-time compiled, and multi-paradigm. It has curly-bracket syntax, dynamic typing, prototype-based object-orientation, and first-class functions. The of this repo is to save my js programs. Basics of JavaScript. Beginner level.

Table of Contents

  1. Important Methods

Methods

Most important javascript build in methods

  • 1.1 typeof: Returns the type.
console.log(typeof 44); // number

console.log(typeof 'something'); // string 

console.log(typeof true); // boolean

let num = 12;
console.log(typeof(num)); // number

  • 1.2 toString: Returns the string representation of the number's value.
let num = 10;
let n = num.toString();

console.log(typeof(num)); // number

console.log(typeof(n)); // string

  • 1.3 indexOf: Returns the first index at which a given element can be found in the array, or -1 if it is not present.
let str = "Hello world, welcome to the JS Universe.";
console.log(str.indexOf("welcome")); // 13
console.log(str.indexOf("wall")); // -1

const fruits = ['Orange', 'Pineapple', 'Apple', 'Melon'];
console.log(fruits.indexOf('Melon')); // 3

console.log(fruits.indexOf('klkljkh')); // -1

  • 1.4 lastIndexOf: Returns the last index at which a given element can be found in the array, or -1 if it is not present.
const fruits = ['Orange', 'Pineapple', 'Apple', 'Melon'];
console.log(fruits.lastIndexOf('Melon')); // 3

console.log(fruits.lastIndexOf('klkljkh')); // -1

  • 1.5 length: Returns the number of characters or size in a string or array.
const fruits = ['Orange', 'Pineapple', 'Apple', 'Melon'];
console.log(fruits.length); // 4

let str = "Hello world, welcome to the JS Universe.";
console.log(str.length); // 40

  • 1.6 Interview Qus: Tricky JavaScript Interview Questions and Answers
// remove duplicates form and array
let arr = [1, 2, 2, 3, 4];

console.log([...new Set(arr)]);

// output test 1
console.log(5 < 6 < 7); // true // 5 < 6 => true => true < 7 => true = 1 => 1 < 7 => true

console.log(7 > 6 > 5); // false // 7 > 6 => true => true > 5 => true = 1 => 1 > 5 = false

console.log(Math.max()); // -Infinity lowest min number in js
console.log(Math.max(1, 2, 3, 4)); // 4


// obj
let profile = {
   name: 'Lakshman'
};

// Object.freeze(profile); // freeze don't allow insert and update
Object.seal(profile); // freeze don't allow insert, remove but allow update

profile.name = 'Gope';

console.log(profile);

// obj
let user = {
   name: 'Gope'
};

// age not allow any update but name does
Object.defineProperty(user, 'age', {
   value: 4,
   writable: false
})

user.name = 'Lakshman'
user.age = 5;

console.log(user); // TypeError: Cannot assign to read only property 'age' of object '#<Object>'

  • 1.5 rename: Rename multiple files extentions at once by a command (Just for Win).
 Get-ChildItem *.css | Rename-Item -NewName { $_.name -Replace '\.css','.scss' }

About

The goal of this repo is to save my js programs. Basics of JavaScript.🗽 🚀

Resources

Readme

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.