Showing posts with label TypeScript. Show all posts
Showing posts with label TypeScript. Show all posts
this.carriers = this.carriers.filter((el, i, a) => i === a.indexOf(el))
atob(): Decodes a string of data which has been encoded using base-64 encoding.
btoa(): Creates a base-64 encoded ASCII string from a "string" of binary data.
The "Unicode Problem": In most browsers, calling btoa() on a Unicode string will cause a Character Out Of Range exception. This paragraph shows some solutions.
Solution to unicode
btoa(): Creates a base-64 encoded ASCII string from a "string" of binary data.
The "Unicode Problem": In most browsers, calling btoa() on a Unicode string will cause a Character Out Of Range exception. This paragraph shows some solutions.
Solution to unicode
var arr1 = [1, 2, 3, 4, 5];
var arr2 = [2, 4];
var arr = arr1.filter(x => { return arr2.indexOf(x) === -1; });
var ids = this.products.map((p) => p.id);
var products= this.selectedProducts.map((p) => { p.id, p.name });
public search(name: string): void {
if (name.trim().length > 0) {
this.employees = this.employeeSource.filter(x => x.name.toLowerCase().indexOf(name.trim().toLowerCase()) >= 0);
}
}
public getTotalWeight(): number {
var total = 0;
if (this.items != null && this.items.length > 0) {
this.items.forEach(x => total += x.weight);
}
return total;
}