Giter Club home page Giter Club logo

javascript-exercises's Introduction

Javascript-Exercises

A list of some exercises I've done with Javascript ๐Ÿคฉ.

Now My Code Exercises Worked ๐Ÿ˜Ž.

  • A Simple Confirm and Alert Approval Message That Ask A User If He/She Is Ready To Leave The Web Application ๐Ÿ˜ฎ. And Adding a Functionality For Incase The User Doesn't Input His/Her Name ๐Ÿคฉ. Made With โค By Me David Mesoma Chigozie. Please Star It ๐Ÿ‘.
        <script>
            let username = prompt(`Enter your name: `);
            let genName = 'User';
            let msg = function() {
                return confirm(`Hey ${username || genName}, Are you leaving now ๐Ÿ™?`);
            }
    
            let newMsg = msg();
    
            if (newMsg == true) {
                alert(`Bye now ${username || genName} ๐Ÿ˜ฅ`)
            } else {
                alert(`Let's continue the Journey ๐Ÿ˜`)
            }
        </script>
    </li>
    
  • A Simple Constructor Function For An Imaginary PC. It Has An Imaginary Device Name, Processor, Installed Ram, Device Id, Product Id and System Type. It Also Has Some Methods That Can Shutdown Your PC, Restart Your PC, Sleep Your PC And Also Logs Your PC Specification and Log Other PC Specification's ๐Ÿ˜ฎ. Made With โค By Me David Mesoma Chigozie. Please Star It ๐Ÿ‘.
        <script>
            const PC = function(device_owner, device_name, processor, installed_ram, device_id, product_id, system_type) {
                this.device_owner = device_owner;
                this.device_name = device_name;
                this.processor = processor;
                this.installed_ram = installed_ram;
                this.device_id = device_id;
                this.product_id = product_id;
                this.system_type = system_type;
                this.shutdownPC = function() {
                    console.log('Shutdown Your PC');
                };
                this.restartPC = function() {
                    console.log('Restart Your PC');
                };
                this.sleepPC = function() {
                    console.log('Sleep Your Pc');
                };
                this.logPCSpec = function() {
                    console.log(`${this.device_owner} is the owner of this PC with device name of ${this.device_name}, has a processor of ${this.processor}, has a ${this.installed_ram} installed RAM and it is good for Programming.`);
                };
                this.otherPCSpec = function() {
                    console.log(`The other specification's are PRIVATE!!.`);
                };
            }
    
            let myPC = new PC('David Mesoma', 'DESKTOP-426U9PI', 'Intel(X) Pentium(X) Dual  CPU  XXXXX  @ 2.16GHz   2.17GHz', '8.00 GB', 'AXAXAXAX-0000-AXAX-0000-AXAXAXAXAXAX', 'XAXAX-00000-00000-XAXAX', '64-bit operating system, x64-based processor');
            myPC.logPCSpec();
            myPC.otherPCSpec();
        </script>
    </li>
    

Note:

You can still access the code on this repo ๐Ÿ™‚. Don't forget to star it and also contribute.โšก

javascript-exercises's People

Contributors

davidmesomaa avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.