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 - mbrsagor/JavaScriptNote: JavaScript ES6 tutorial

BranchesTags
Open more actions menu

Latest commit

 

History

240 Commits
240 Commits

Folders and files

NameName
Last commit message
Last commit date
basic
basic
 
 
components
components
 
 
data
data
 
 
docker
docker
 
 
dom
dom
 
 
es5
es5
 
 
functions
functions
 
 
import
import
 
 
jquery
jquery
 
 
node
node
 
 
oop
oop
 
 
others
others
 
 
tryCatch
tryCatch
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
index.js
index.js
 
 
package.json
package.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

JavaScript

Coding with Bozlur Rosid Sagor.

In this topic, I will use Visual Studio Code (VS Code). First, install Node.js and NPM (Node Package Manager), then install VS Code on your system. JavaScript ES6 features are awesome. If you learn ES6, you may easily handle React, VUE, Angular projects.

document.designMode = "on"
my_bio = () => "The simplest changes make a huge difference.";
Install Node on Mac.

First, install Homebrew. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then you may follow the commands

brew update
brew doctor

Next, add Homebrew’s location to your $PATH in your .bash_profile or .zshrc file.

export PATH="/usr/local/bin:$PATH"
brew install node
npm install -g grunt-cli
Check the Node and NPM versions:
npm -v
node -v
Features:
  • ES6 basic

    • Variable data type
    • Map
    • Filter
    • Conditional Statement
  • Special data types

    • Fibonacci
    • Factorial
    • Recursion
    • Stack
    • Queue
    • Linked list
    • Binary search
  • Loop

    • For loop
    • While loop
    • Do-while loop
  • Function

    • Old function
    • Arrow function
    • Callback function
    • Promise
  • OOP

    • Class
    • Constructor
    • Object
Intro to the filter method
arrayObject.filter(callback, contextObject);

The filter() method creates a new array with all the elements that pass the test implemented by the callback() function. Internally, the filter() method iterates over each element of the array and passes each element to the callback function. If the callback function returns true, it includes the element in the return array. The filter() method accepts two named arguments: a callback function and an optional object.

Generator in JavaScript: Base64 converter
// Helper function to convert file to Base64
  const convertToBase64 = (file) => {
    return new Promise((resolve, reject) => {
      const reader = new FileReader();
      reader.onload = () => resolve(reader.result);
      reader.onerror = (error) => reject(error);
      reader.readAsDataURL(file);
    });
  };

####### Convert:

const handleFileChange = async (event) => {
    const file = event.target.files[0];
    if (file) {
      try {
        const base64 = await convertToBase64(file);
        setIcon(base64); // Save Base64 string
      } catch (err) {
        console.error("Error converting file to Base64:", err);
      }
    }
  };
console.log(NaN === NaN);

About

JavaScript ES6 tutorial

Topics

es5-javascriptes6-javascriptjavascript-es6-tutorialoop

Resources

Readme
Activity

Stars

5 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

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.