I started working with Flask and JavaScript a few weeks for a new project. When working with JS, I was noticing that Python and JS seemed similar. I thought it would be interesting to build notebooks showing the same tasks completed in both languages.
For now, I am using Jupyter Notebooks with a Python 3 kernel. Then when running a cell with JS code
simply start the cell with %%js
or %%javascript
(magic commands). However, I can only log/print one line
at a time and have to use element.text
instead of console.log
.
Additionally, I tried using JupyterLab and was unable to run JavaScript the same way in the classic notebook. However, you can use a JaveScript (Node.js) kernal and simply run JavaScript.
Install JavaScript kernel Jupyter Notebook
- Strings
- Numbers and Strings
- More Strings
- Functions
- Simple Function
- Passing Parameters
- Passing Parameters with Defaults
- *args and **kwargs
- Nameless Functions
- Anonymous Functions Arrow & Lambda
- Arrow Function & forEach
- Simple If
NEED TO ADD MORE / UPDATES REQUIRED
- Length of Objects
- Type & typeOf
- Indexing
- Return All
- Slicing, Dicing & Splicing
- Modifying
- Looping over Array
forEach
& Listenumerate
- Filter
- Includes | in
- Join
- Split
- Map
Adding Reduce and more
Comparing the JavaScript and Python class
. We start with exploring the JS constructor
pre ES6 and then switch
to post ES6 when JS introduces class.