Giter Club home page Giter Club logo

tt-msk's Introduction

Links

Deps

  • Vue 3 composition api
  • Javascript
  • CSS modules

Run

Dev
npm run dev
Preview
npm run build && npm run preview

Javascript Tasks

  1. Выполнится приведение типов к строке и конкатенация

    console.log([1, 2, 3] + [4, 5, 6]) // '1,2,34,5,6'
  2. Присваивание объектов происходит по ссылке. (в переменной b лежит ссылка на значение a)

    var a = { b: 1 }
    var b = a
    
    b.b = 2
    
    console.log(a) // { b: 2 }
  3. Не пропускает 00.1, 0.0.1, 0.1000

    /(0|[1-9]\d*)([.,])([0-9]{1,3})/g
  4. Строка проверяется на наличие:

    • https или http и ://
    • www.
    • host'а
    • path'а
    • query
    • anchor'а
    /(https|http):\/\/(www\.)?([-a-zA-Z0-9]+\.)+([a-z]{2,6}(:\d+)?)(\/[a-zA-Z0-9]*)*(\?[a-zA-Z0-9@:%_+.~#?&/=-]*)?/g
  5. Function и var имеют механизм hoisting'а, поэтому доступны до своего объявления

    function setText(message) {
        text = message
    }
    
    var text = 'Текст'
    
    console.log(setText('Сообщение')) // 'Сообщение'
  6. Возвращает массив артикулов строкового типа

    /** @return {(string|null)[]} */
    function getVendorList() {
        const productList = document.querySelectorAll('._product')
    
        return Array.from(productList).map((product) => product.dataset?.id ? `0${product.dataset.id}` : null)
    }
  7. Возвращает объект с ключом и значением строкового типа

    /** @return {Record<string, string>} */
    function getProperties() {
        const properties = {}
    
        const namePropertyList = document.querySelectorAll('.parameter-name')
        const valuePropertyList = document.querySelectorAll('.parameter-name ~ .parameter-value')
    
        for (const [i, nameProperty] of namePropertyList.entries()) {
            properties[nameProperty.firstChild.textContent.trim()] = valuePropertyList[i].firstChild.textContent.trim()
        }
    
        return properties
    }

tt-msk's People

Contributors

markgrushevski 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.