Skip to content Skip to sidebar Skip to footer
Showing posts with the label Ecmascript 6

Javascript Split String With Backslash

I get from server some path like that: \some\some\some\some\mainSome And for display it to front, I… Read more Javascript Split String With Backslash

Babel-preset-env Syntaxerror: Unexpected Token With Spread Properties

Why its not accepting spread properties ? I am using babel-preset-env for this. .babelrc { '… Read more Babel-preset-env Syntaxerror: Unexpected Token With Spread Properties

Javascript: Using `.includes` To Find If An Array Of Objects Contains A Specific Object

I am a bit new to javascript ES6, and I am having difficulty understanding why the below is not fun… Read more Javascript: Using `.includes` To Find If An Array Of Objects Contains A Specific Object

Extend A String Class In Es6

I can write the following in ES5: String.prototype.something=function(){ return this.split(' … Read more Extend A String Class In Es6

Set Key In A Javascript Generator Function

Hi I'm trying to figure out how to set up the key in a symbol iterator, this is the code I have… Read more Set Key In A Javascript Generator Function

React-bootstrap Not Allowing `import {components}` Syntax

This is kinda weird. It works with other projects, but not with React-Bootstrap. For example; impor… Read more React-bootstrap Not Allowing `import {components}` Syntax

Difference Between Classical Inheritance And Prototype Inheritance

I found this definition here : https://medium.com/javascript-scene/10-interview-questions-every-jav… Read more Difference Between Classical Inheritance And Prototype Inheritance

Filter Object Props Based On The Specified Array

I have an object with the following structure { cardControlItem: 'Tidak', cardDirectUseIt… Read more Filter Object Props Based On The Specified Array

Using Es6 Arrow Functions Inside Class

When i change a function draw(){ //} to draw = () => { // } I am getting an error like 'Unca… Read more Using Es6 Arrow Functions Inside Class

Es6 Proxy: Set() Trap Not Triggering, When Setting Inside Target Object's Method

Example: let foo = {bar: 'baz', method() { this.bar = 'baz2' }} let fooProxy = new … Read more Es6 Proxy: Set() Trap Not Triggering, When Setting Inside Target Object's Method

What's The Difference Between Function And => In Typescript?

Currently, I am learning TypeScript. I am quite confused about the difference between keyword funct… Read more What's The Difference Between Function And => In Typescript?

Wait For One Fetch To Finish Before Starting The Next

I have a list of data that I am sending to google cloud. My current code looks like this: const tea… Read more Wait For One Fetch To Finish Before Starting The Next

Replace Array Of Object With Another Array Of Object Base On Property

How to replace array of object with another array of object base on property? var arr = [ {'… Read more Replace Array Of Object With Another Array Of Object Base On Property

Javascript / Es6 -- Replace Some Keys In An Array Of Objects, Given Key Map

I have some (potentially very large) array of objects like this: [ { 'before1' => val… Read more Javascript / Es6 -- Replace Some Keys In An Array Of Objects, Given Key Map

How Exactly Does The Spread Syntax (...) Work With Mapgetters?

Whenever you want to use a computed getter with the mapGetter helper from Vuex you would use it lik… Read more How Exactly Does The Spread Syntax (...) Work With Mapgetters?

How To Declare Private Variables And Private Methods In Es6 Class

in es5 we use constructor function function Person(name,gender){ var initial =''; … Read more How To Declare Private Variables And Private Methods In Es6 Class

Deep-cloning An Object Using Object.fromentries()

Sometime ago, I read about the proposal of the new method Object.fromEntries() that is supported on… Read more Deep-cloning An Object Using Object.fromentries()

How To Leverage Event Loop In Javascript And Node.js?

Is the concept of event loop general or specific to languages? I am looking for detailed explanatio… Read more How To Leverage Event Loop In Javascript And Node.js?

Succinct/concise Syntax For 'optional' Object Keys In Es6/es7?

There are already a lot of cool features in ES6/ES7 for defining Javascript objects. However, the f… Read more Succinct/concise Syntax For 'optional' Object Keys In Es6/es7?

Es6 Functions, Arrow Functions And 'this' In An Es6 Class

class App extends Component { constructor(props) { ... } onChange = (e) => this.setSt… Read more Es6 Functions, Arrow Functions And 'this' In An Es6 Class