To answer your question directly, let's look at the de facto definition of strongly typed as it is discussed here:
In a "strongly typed" language, it is not possible for the programmer to work around the restrictions imposed by the type system. This term is almost always used to describe statically typed languages.
JavaScript is untyped. There are no restrictions imposed by the type system to even work around (until runtime). Hence, you cannot achieve "AngularJS strong typing" with vanilla JavaScript.
That said, you can use JavaScript and catch type-related errors. Augmented JS (TypeScript or Flow annotations) can achieve full static typing, and a subset of full static typing can be achieved with type inference on Vanilla JS (Flow without annotations). Read on for details.
Use the statically typed TypeScript. It compiles to JS and is usable within powerful IDEs like Visual Studio.
class Person {
private name: string;
private age: number;
private salary: number;
constructor(name: string, age: number, salary: number) {
this.name = name;
this.age = age;
this.salary = salary;
}
toString(): string {
return `${this.name} (${this.age}) (${this.salary})`; // As of version 1.4
}
}
Use an analysis tool like Flow. Flow will analyze vanilla JS for obvious type errors (misuses of inferred types):
/* @flow */
function foo(x) {
return x * 10;
}
foo('Hello, world!');
throws
7: foo("Hello, world!");
^^^^^^^^^^^^^^^^^^^^ function call
4: return x*10;
^ string. This type is incompatible with
4: return x*10;
^^^^ number
and you can use annotations to augment vanilla JS for more powerful type checking:
/* @flow */
function foo(x: string, y: number): string {
return x.length * y;
}
foo('Hello', 42);
throws
4: return x.length * y;
^^^^^^^^^^^^ number. This type is incompatible with
3: function foo(x: string, y: number): string {
^^^^^^ string