Giter Site home page Giter Site logo

bue's Introduction

Hi there 👋, I'm Bowen

  • 🦄 I am a Full-Stack Engineer with a strong focus on Front-End development.
  • 💻 My programing language: JavaScript/TypeScript, Go, and Dart.
  • 🔭 I am currently searching for job opportunities, preferring to work remotely or start a business.
  • 📫 You can contact me through the following email addresses:
  • 🔗 You can also check out my blog at: https://blog.bowen.cool

bue's People

Contributors

bowencool avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lcwlucky qanora

bue's Issues

为什么不用原生的typeof检测类型呢

export function typeOf(wtf: any): string {

export function typeOf(wtf: any): string {
	return Object.prototype.toString
		.call(wtf)
		.slice(8, -1)
		.toLowerCase();
}
  1. 试了一下typeOf(null) 返回了object ...貌似没有解决typeof null 的问题
  2. toString 的方式会被Symbol(Symbol.toStringTag) 改写

针对第2点,如:

a = { 
 get [Symbol.toStringTag]() {
    return "[object,Whatever]";
  }
}
{}
typeOf(a) // [object,whatever]

可以使用:value=> value === null ? 'null' : typeof value

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.