Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Web Development with Jade

You're reading from   Web Development with Jade Knowing Jade makes life simpler and more productive for web developers, and this book will teach you the language concisely and thoroughly using lots of practical examples and best practices for a solid grounding.

Arrow left icon
Product type Paperback
Published in Mar 2014
Publisher
ISBN-13 9781783286355
Length 80 pages
Edition Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Sean Lang Sean Lang
Author Profile Icon Sean Lang
Sean Lang
Arrow right icon
View More author details
Toc

A warning about interpolation


Interpolation cannot be used in code blocks, including vanilla JS and the built-in variants. For example, consider the following code snippet:

Jade

HTML

- var there = "foo"
- title = "Hello #{there}"
p #{title}
<p>Hello #{there}</p>

If interpolation worked in code, it would print out Hello foo. The reason why interpolation can't be used in code blocks is because vanilla JS has no interpolation, and very little processing is done to the code before it is executed (even the built-in shorthands). So, allowing interpolation in these places would require extensive rewriting of the code blocks during compilation. However, once Template Strings are implemented in ES6 (the next version of JavaScript) this won't be an issue.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime